#!/usr/bin/perl
+use warnings;
+use strict;
use Getopt::Long;
use Pod::Usage;
use File::Path;
use File::Temp;
-my $tag;
-my $last;
+my $help;
+my $man;
my $tagPoint;
my $last;
my $outDir = ".";
system ("cd $tempDir/$name && ./regen.sh") == 0
or die $!;
+# A list of files to compress
+my @toCompress;
+
# Create the documentation tarball
system("tar -cf $outDir/$name-doc.tar -C $tempDir $name/doc") == 0
or die "Unable to create documentation tarball : $!";
push @toCompress, "$outDir/$name.diff";
}
-my @toMD5 = @toCompress;
+my @toMD5;
-# Compress everything that needs squashing
+# Compress everything that needs squashing,
+# and also set up a list for md5 checksumming.
foreach my $file (@toCompress) {
system("gzip < $file > $file.gz") == 0
or die "Unable to create gzip file of '$file' : $!";
system("bzip2 < $file > $file.bz2") == 0
or die "Unable to create bzip file of '$file' : $!";
push @toMD5, "$file.bz2";
+
+ # Delete the uncompressed tar files.
+ if ($file =~ /\.tar$/) {
+ unlink($file);
+ } else {
+ # Otherwise, queue this file for md5 checksumming.
+ push @toMD5, $file;
+ }
}
foreach my $file (@toMD5) {