2755: Fix handling of stripped/orig manifest text.
authorTom Clegg <tom@curoverse.com>
Thu, 12 Jun 2014 19:14:22 +0000 (15:14 -0400)
committerTom Clegg <tom@curoverse.com>
Thu, 12 Jun 2014 19:14:22 +0000 (15:14 -0400)
sdk/cli/bin/crunch-job

index 628fea8796ea9aa9a83e61b29203464abddf627d..e30efd902445fe46eebd467800248428213c45ef 100755 (executable)
@@ -820,20 +820,22 @@ if ($collated_output)
         or die "failed to get collated manifest: $!";
     # Read the original manifest, and strip permission hints from it,
     # so we can put the result in a Collection.
-    my @manifest_lines = ();
+    my @stripped_manifest_lines = ();
+    my $orig_manifest_text = '';
     while (my $manifest_line = <$orig_manifest>) {
+      $orig_manifest_text .= $manifest_line;
       my @words = split(/ /, $manifest_line, -1);
       foreach my $ii (0..$#words) {
         if ($words[$ii] =~ /^[0-9a-f]{32}\+/) {
           $words[$ii] =~ s/\+A[0-9a-f]{40}@[0-9a-f]{8}\b//;
         }
       }
-      push(@manifest_lines, join(" ", @words));
+      push(@stripped_manifest_lines, join(" ", @words));
     }
-    my $stripped_manifest_text = join("", @manifest_lines);
+    my $stripped_manifest_text = join("", @stripped_manifest_lines);
     my $output = $arv->{'collections'}->{'create'}->execute('collection' => {
       'uuid' => md5_hex($stripped_manifest_text),
-      'manifest_text' => $manifest_text,
+      'manifest_text' => $orig_manifest_text,
     });
     $Job->update_attributes('output' => $output->{uuid});
     if ($Job->{'output_is_persistent'}) {