audreyt / module-signature

Module signature file manipulation
http://github.com/audreyt/module-signature
16 stars 28 forks source link

Feature req: cpansign -v <distname>.tar.gz #6

Open rurban opened 9 years ago

rurban commented 9 years ago

EUMM has broken distsignature rules with parallel make (see https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/177) so it would be nice to easier check the generated tar.gz, not only .zip. Add tar.gz support to _unzip_to_tmpdir

make dist # with SIGN=>1
cpansign -v <generated-tar.gz>

Very often the generation of META.json is delayed, thus the SIGNATURE invalid.

rurban commented 9 years ago

Since I cannot rely on Par::Dist to add support for tar, this is the code I came up with:

  if (@ARGV and -e $ARGV[-1]) {
      my $file = $ARGV[-1];
      require PAR::Dist;
      if ($file =~ /\.tar\.gz$/) {
          *PAR::Dist::_unzip = sub {
              my %args = &PAR::Dist::_args; 
              my $dist = $args{'dist'};
              my $path = $args{'path'} || File::Spec->curdir;
              return unless -f $dist;
              system "tar xfz $dist -C $path";
          };
      }
      PAR::Dist::_verify_or_sign(
          dist => $file,
          $dwim ? () : (action => $cmd, @args)
      );
    }

but it is missing the extracted dir of the dist, which needs to be added to the tmpdir.