perl
view release on metacpan or search on metacpan
Porting/core-cpan-diff view on Meta::CPAN
\@wanted_upstreams
);
}
}
# construct a CPAN url
sub cpan_url {
my ( $mirror_url, @path ) = @_;
return $mirror_url unless @path;
my $cpan_path = join( "/", map { split "/", $_ } @path );
$cpan_path =~ s{\A/}{}; # remove leading slash since url has one trailing
return $mirror_url . $cpan_path;
}
# construct a CPAN URL for a author/distribution string like:
# BINGOS/Archive-Extract-0.52.tar.gz
sub cpan_url_distribution {
my ( $mirror_url, $distribution ) = @_;
$distribution =~ /^([A-Z])([A-Z])/
or die "ERROR: invalid DISTRIBUTION name (not /^[A-Z]{2}/): $distribution\n";
my $path = "authors/id/$1/$1$2/$distribution";
cpan/CPAN/lib/CPAN/Distribution.pm view on Meta::CPAN
@local = split(/\//,$self->id);
pop @local;
push @local, "CHECKSUMS";
$lc_want =
File::Spec->catfile($CPAN::Config->{keep_source_where},
"authors", "id", @local);
local($") = "/";
if (my $size = -s $lc_want) {
$self->debug("lc_want[$lc_want]size[$size]") if $CPAN::DEBUG;
my @stat = stat $lc_want;
my $epoch_starting_support_of_cpan_path = 1637471530;
if ($stat[9] >= $epoch_starting_support_of_cpan_path) {
if ($self->CHECKSUM_check_file($lc_want, 1)) {
return $self->{CHECKSUM_STATUS} = "OK";
}
} else {
unlink $lc_want;
}
}
$lc_file = CPAN::FTP->localize("authors/id/@local",
$lc_want,1);
unless ($lc_file) {
cpan/CPAN/lib/CPAN/Distribution.pm view on Meta::CPAN
$CPAN::Frontend->mywarn(qq{
Warning: checksum file '$chk_file' broken.
When trying to read that file I expected to get a hash reference
for further processing, but got garbage instead.
});
my $answer = CPAN::Shell::colorable_makemaker_prompt("Proceed nonetheless?", "no");
$answer =~ /^\s*y/i or $CPAN::Frontend->mydie("Aborted.\n");
$self->{CHECKSUM_STATUS} = "NIL -- CHECKSUMS file broken";
return;
} elsif (exists $cksum->{$basename} && ! exists $cksum->{$basename}{cpan_path}) {
$CPAN::Frontend->mywarn(qq{
Warning: checksum file '$chk_file' not conforming.
The cksum does not contain the key 'cpan_path' for '$basename'.
});
my $answer = CPAN::Shell::colorable_makemaker_prompt("Proceed nonetheless?", "no");
$answer =~ /^\s*y/i or $CPAN::Frontend->mydie("Aborted.\n");
$self->{CHECKSUM_STATUS} = "NIL -- CHECKSUMS file without cpan_path";
return;
} elsif (exists $cksum->{$basename} && substr($self->{ID},0,length($cksum->{$basename}{cpan_path}))
ne $cksum->{$basename}{cpan_path}) {
$CPAN::Frontend->mywarn(qq{
Warning: checksum file not matching path '$self->{ID}'.
The cksum contain the key 'cpan_path=$cksum->{$basename}{cpan_path}'
which does not match the ID of the distribution '$self->{ID}'.
Something's suspicious might be going on here. Please investigate.
});
my $answer = CPAN::Shell::colorable_makemaker_prompt("Proceed nonetheless?", "no");
$answer =~ /^\s*y/i or $CPAN::Frontend->mydie("Aborted.\n");
$self->{CHECKSUM_STATUS} = "NIL -- CHECKSUMS non-matching cpan_path vs. ID";
return;
} elsif (exists $cksum->{$basename}{sha256}) {
$self->debug("Found checksum for $basename:" .
"$cksum->{$basename}{sha256}\n") if $CPAN::DEBUG;
open($fh, $file);
binmode $fh;
my $eq = $self->eq_CHECKSUM($fh,$cksum->{$basename}{sha256});
$fh->close;
$fh = CPAN::Tarzip->TIEHANDLE($file);
cpan/CPAN/lib/CPAN/Distribution.pm view on Meta::CPAN
my $cpan_version = $mo->cpan_version;
my $is_lower = CPAN::Version->vlt($version, $cpan_version);
my $other_dist;
if (my $mo_dist = $mo->distribution) {
$other_dist = $mo_dist->pretty_id;
my $dni = CPAN::DistnameInfo->new($other_dist);
if ($dni->dist eq $dist_dist){
if (CPAN::Version->vgt($dni->version, $dist_version)) {
push @outdd, {
pmpath => $pmpath,
cpan_path => $dni->pathname,
dist_version => $dni->version,
dist_dist => $dni->dist,
};
}
}
}
}
if (@outdd && $allow_outdd ne "yes") {
my $why = "allow_installing_outdated_dists: $id contains module(s) that are indexed on the CPAN with a different distro: (e.g. '$outdd[0]{pmpath}' is indexed with '$outdd[0]{cpan_path}')";
if ($outdd[0]{dist_dist} eq $dist_dist) {
$why .= ", and this has a higher distribution-version, i.e. version '$outdd[0]{dist_version}' is higher than '$dist_version')";
}
if (my($default) = $allow_outdd =~ m|^ask/(.+)|) {
$default = "yes" unless $default =~ /^(y|n)/i;
my $answer = CPAN::Shell::colorable_makemaker_prompt
("$why. Do you want to allow installing it?",
$default, "colorize_warn");
$allow_outdd = $answer =~ /^\s*y/i ? "yes" : "no";
}
( run in 0.280 second using v1.01-cache-2.11-cpan-f79bc02f770 )