CPAN-Checksums

 view release on metacpan or  search on metacpan

lib/CPAN/Checksums.pm  view on Meta::CPAN

      scalar gmtime, $VERSION, $ddump;
  print $fh $message;
  my $success = close $fh;
  if ($SIGNING_KEY && !$success) {
    warn "Couldn't run '$SIGNING_PROGRAM $SIGNING_KEY'!
Writing to $tckfn directly";
    open $fh, ">$tckfn\0" or die "Couldn't open >$tckfn\: $!";
    print $fh $message;
    close $fh or warn "Couldn't close $tckfn: $!";
  }
  chmod 0644, $ckfn or die "Couldn't chmod to 0644 for $ckfn\: $!" if -f $ckfn;
  rename $tckfn, $ckfn or die "Could not rename: $!";
  chmod 0444, $ckfn or die "Couldn't chmod to 0444 for $ckfn\: $!";
  return 2;
}

sub _add_digests ($$$$$$$) {
  my($de,$dref,$module,$constructor_args,$keyname,$abs,$old_dref) = @_;
  my($fh) = new IO::File;
  my $dig = $module->new(@$constructor_args);
  $fh->open("$abs\0") or die "Couldn't open $abs: $!";
  binmode($fh); # make sure it's called as a function, solaris with
                # perl 5.8.4 complained about missing method in

t/updatedir.t  view on Meta::CPAN

if (eval { require Time::HiRes; 1; }) {
    $HAVE_TIME_HIRES = 1;
}

use_ok("CPAN::Checksums");
my $ret = CPAN::Checksums::updatedir("t", $absroot);
ok($ret >= 1, "ret[$ret]");

my $warn;
{
    chmod 0644, _f"t/43";
    local *F;
    open F, ">", _f"t/43" or die;
    print F "4321\n" x 1_000_000;
    close F;
    local $CPAN::Checksums::CAUTION;
    $CPAN::Checksums::CAUTION=1;
    $SIG{__WARN__} = sub { $warn = shift; };
    $ret = CPAN::Checksums::updatedir("t", $absroot);
    is($ret,2,"changed once");



( run in 0.245 second using v1.01-cache-2.11-cpan-496ff517765 )