3 # This tool unpacks a full update package generated by make_full_update.sh
4 # Author: Benjamin Smedberg
7 # -----------------------------------------------------------------------------
8 # By default just assume that these tools exist on our path
12 my ($MAR, $BZIP2, $archive, @marentries, @marfiles);
14 if (defined($ENV{"MAR"})) {
21 if (defined($ENV{"BZIP2"})) {
22 $BZIP2 = $ENV{"BZIP2"};
30 print "Usage: unwrap_full_update.pl [OPTIONS] ARCHIVE\n\n";
31 print "The contents of ARCHIVE will be unpacked into the current directory.\n\n";
33 print " -h show this help text\n";
39 if (defined($opts{'h'}) || scalar(@ARGV) != 1) {
45 @marentries = `"$MAR" -t "$archive"`;
47 $?
&& die("Couldn't run \"$MAR\" -t");
51 system("$MAR -x \"$archive\"") == 0 || die "Couldn't run $MAR -x";
53 foreach (@marentries) {
55 my @splits = split(/\t/,$_);
56 my $file = $splits[2];
58 system("mv \"$file\" \"$file.bz2\"") == 0 ||
59 die "Couldn't mv \"$file\"";
60 system("\"$BZIP2\" -d \"$file.bz2\"") == 0 ||
61 die "Couldn't decompress \"$file\"";