summaryrefslogtreecommitdiffstats
path: root/tools/update-packaging/unwrap_full_update.pl
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /tools/update-packaging/unwrap_full_update.pl
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'tools/update-packaging/unwrap_full_update.pl')
-rwxr-xr-xtools/update-packaging/unwrap_full_update.pl67
1 files changed, 67 insertions, 0 deletions
diff --git a/tools/update-packaging/unwrap_full_update.pl b/tools/update-packaging/unwrap_full_update.pl
new file mode 100755
index 000000000..ead1157db
--- /dev/null
+++ b/tools/update-packaging/unwrap_full_update.pl
@@ -0,0 +1,67 @@
+#!/usr/bin/perl -w
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#
+# This tool unpacks a full update package generated by make_full_update.sh
+# Author: Benjamin Smedberg
+#
+
+# -----------------------------------------------------------------------------
+# By default just assume that these tools exist on our path
+
+use Getopt::Std;
+
+my ($MAR, $BZIP2, $archive, @marentries, @marfiles);
+
+if (defined($ENV{"MAR"})) {
+ $MAR = $ENV{"MAR"};
+}
+else {
+ $MAR = "mar";
+}
+
+if (defined($ENV{"BZIP2"})) {
+ $BZIP2 = $ENV{"BZIP2"};
+}
+else {
+ $BZIP2 = "bzip2";
+}
+
+sub print_usage
+{
+ print "Usage: unwrap_full_update.pl [OPTIONS] ARCHIVE\n\n";
+ print "The contents of ARCHIVE will be unpacked into the current directory.\n\n";
+ print "Options:\n";
+ print " -h show this help text\n";
+}
+
+my %opts;
+getopts("h", \%opts);
+
+if (defined($opts{'h'}) || scalar(@ARGV) != 1) {
+ print_usage();
+ exit 1;
+}
+
+$archive = $ARGV[0];
+@marentries = `"$MAR" -t "$archive"`;
+
+$? && die("Couldn't run \"$MAR\" -t");
+
+shift @marentries;
+
+system("$MAR -x \"$archive\"") == 0 || die "Couldn't run $MAR -x";
+
+foreach (@marentries) {
+ tr/\n\r//d;
+ my @splits = split(/\t/,$_);
+ my $file = $splits[2];
+
+ system("mv \"$file\" \"$file.bz2\"") == 0 ||
+ die "Couldn't mv \"$file\"";
+ system("\"$BZIP2\" -d \"$file.bz2\"") == 0 ||
+ die "Couldn't decompress \"$file\"";
+}
+