remove underscores from version using tr rather than eval
[p5sagit/Distar.git] / helpers / verify-tarball
index 0da438b..3a88e3e 100755 (executable)
@@ -12,16 +12,16 @@ GetOptions(
 
 my ($tarball, $manifest) = @ARGV;
 my $type
-  = $tarball =~ /\.bz2$/  ? 'j'
-  : $tarball =~ /\.xz$/   ? 'J'
-  : $tarball =~ /\.t?gz$/ ? 'z'
-  : $tarball =~ /\.Z$/    ? 'Z'
+  = $tarball =~ /\.bz2$/  ? '-j'
+  : $tarball =~ /\.xz$/   ? '-J'
+  : $tarball =~ /\.t?gz$/ ? '-z'
+  : $tarball =~ /\.Z$/    ? '-Z'
   : '';
 
 my @tarfiles;
 {
   my $null = File::Spec->devnull;
-  @tarfiles = `$tar -t -$type -f $tarball 2>$null`;
+  @tarfiles = `$tar -t $type -f "$tarball" 2>$null`;
   chomp @tarfiles;
 }
 
@@ -56,6 +56,10 @@ if (@extra) {
 if (@missing) {
   $message .= "$tarball is missing files:\n" . join '', map "  $_\n", @missing;
 }
-die $message
-  if $message;
+if ($message) {
+  die $message . <<'END_MESSAGE';
+
+This may happen if the file attributes are not compatible with the ustar format.
+END_MESSAGE
+}
 exit 0;