Bug 1405068: Don't use a shell for running subcommands in unwrap_full_update.pl.
MozReview-Commit-ID: JDhndUIhOT1
--- a/tools/update-packaging/unwrap_full_update.pl
+++ b/tools/update-packaging/unwrap_full_update.pl
@@ -70,17 +70,17 @@ if (defined($opts{'h'}) || scalar(@ARGV)
print_usage();
exit 1;
}
$archive = $ARGV[0];
@marentries = `"$MAR" -t "$archive"`;
$? && die("Couldn't run \"$MAR\" -t");
-system("$MAR -x \"$archive\"") == 0 ||
+system($MAR, "-x", $archive) == 0 ||
die "Couldn't run $MAR -x";
# Try to determine if the mar file contains bzip2 compressed files and if not
# assume that the mar file contains lzma compressed files. The updatev3.manifest
# file is checked since a valid mar file must have this file in the root path.
open(my $testfilename, "updatev3.manifest") or die $!;
binmode($testfilename);
read($testfilename, my $bytes, 3);
@@ -95,23 +95,23 @@ shift @marentries;
foreach (@marentries) {
tr/\n\r//d;
my @splits = split(/\t/,$_);
my $file = $splits[2];
print "Decompressing: " . $file . "\n";
if ($MAR_OLD_FORMAT) {
- system("mv \"$file\" \"$file.bz2\"") == 0 ||
+ system("mv", $file, "$file.bz2") == 0 ||
die "Couldn't mv \"$file\"";
- system("\"$BZIP2\" -d \"$file.bz2\"") == 0 ||
+ system($BZIP2, "-d", "$file.bz2") == 0 ||
die "Couldn't decompress \"$file\"";
}
else {
- system("mv \"$file\" \"$file.xz\"") == 0 ||
+ system("mv", $file, "$file.xz") == 0 ||
die "Couldn't mv \"$file\"";
- system("\"$XZ\" -d \"$file.xz\"") == 0 ||
+ system($XZ, "-d", "$file.xz") == 0 ||
die "Couldn't decompress \"$file\"";
}
}
print "Finished\n";