view release on metacpan or search on metacpan
lib/CPAN/Checksums.pm view on Meta::CPAN
use Data::Compare ();
use Digest::SHA ();
sub _dir_to_dref {
my($dirname,$old_dref,$root) = @_;
my $cpan_path = File::Spec->abs2rel( $dirname, $root ) ;
my($dref) = {};
my($dh)= DirHandle->new;
my($fh) = new IO::File;
$dh->open($dirname) or die "Couldn't opendir $dirname\: $!";
my(%shortnameseen);
lib/CPAN/Checksums.pm view on Meta::CPAN
} else {
_add_digests($de,$dref,"Digest::MD5",[],"md5",$abs,$old_dref);
}
} # ! -d
$dref->{$de}{cpan_path} = $cpan_path;
}
$dh->close;
$dref;
}
lib/CPAN/Checksums.pm view on Meta::CPAN
$dir is a directory. Updatedir() writes a C<CHECKSUMS> file into that
directory, unless a previously written C<CHECKSUMS> file is there that
is still valid. Returns 2 if a new C<CHECKSUMS> file has been written,
1 if a valid C<CHECKSUMS> file is already there, otherwise dies.
If $root is given, the hash entry with the key C<cpan_path> is
relative to this root directory.
Note: since version 2.0 updatedir on empty directories behaves just
the same. In older versions it silently did nothing.
view all matches for this distribution
view release on metacpan or search on metacpan
0.37 2023-06-06
* add a test dependency
0.36 2023-06-06
* implement compatibility with new toolchain cpan_path regime
* skip permission tests on cygwin
0.35 2017-07-19
* use Net::EmptyPort to find an empty port to use
instead of a hard-coded one
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/PackageDetails.pm view on Meta::CPAN
If any of these checks fail, C<check_file> croaks with a hash reference
with these keys:
# present in every error object
filename the FILE you passed in
cpan_path the CPAN_PATH you passed in
cwd the current working directory
error_count
# if FILE is missing
missing_file exists and true if FILE doesn't exist
lib/CPAN/PackageDetails.pm view on Meta::CPAN
sub ENTRY_COUNT_MISMATCH () { 1 }
sub MISSING_IN_REPO () { 2 }
sub MISSING_IN_FILE () { 3 }
sub check_file {
my( $either, $file, $cpan_path ) = @_;
# works with a class or an instance. We have to create a new
# instance, so we need the class. However, I'm concerned about
# subclasses, so if the higher level application just has the
# object, and maybe from a class I don't know about, they should
lib/CPAN/PackageDetails.pm view on Meta::CPAN
my $class = ref $either || $either;
# file exists
my $error = {
error_count => 0,
cpan_path => $cpan_path,
filename => $file,
cwd => cwd(),
};
unless( -e $file ) {
$error->{missing_file} = 1;
lib/CPAN/PackageDetails.pm view on Meta::CPAN
$error->{line_count} = $header_count;
$error->{entry_count} = $entries_count;
$error->{error_count} += 1;
}
if( $cpan_path ) {
my $missing_in_file = $packages->check_for_missing_dists_in_file( $cpan_path );
my $missing_in_repo = $packages->check_for_missing_dists_in_repo( $cpan_path );
$error->{missing_in_file} = $missing_in_file if @$missing_in_file;
$error->{missing_in_repo} = $missing_in_repo if @$missing_in_repo;
$error->{error_count} += @$missing_in_file + @$missing_in_repo;
}
lib/CPAN/PackageDetails.pm view on Meta::CPAN
error output.
=cut
sub check_for_missing_dists_in_repo {
my( $packages, $cpan_path ) = @_;
my @missing;
my( $entries ) = $packages->as_unique_sorted_list;
foreach my $entry ( @$entries ) {
my $path = $entry->path;
my $native_path = catfile( $cpan_path, split m|/|, $path );
push @missing, $path unless -e $native_path;
}
return \@missing;
lib/CPAN/PackageDetails.pm view on Meta::CPAN
error output.
=cut
sub check_for_missing_dists_in_file {
my( $packages, $cpan_path ) = @_;
my $dists = $packages->_get_repo_dists( $cpan_path );
$packages->_filter_older_dists( $dists );
my %files = map { $_, 1 } @$dists;
use Data::Dumper;
my( $entries ) = $packages->as_unique_sorted_list;
foreach my $entry ( @$entries ) {
my $path = $entry->path;
my $native_path = catfile( $cpan_path, split m|/|, $path );
delete $files{$native_path};
}
[ keys %files ];
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/CPAN/authors/id/A/AN/ANDK/CHECKSUMS view on Meta::CPAN
# CHECKSUMS file written on Mon Jan 28 13:21:04 2008 GMT by CPAN::Checksums (v1.064)
$cksum = {
'Bogus-OSUnsupported-0.01.tar.gz' => {
'cpan_path' => 'A/AN/ANDK',
'md5' => '1e054a7da63e22a7b5acb98baaa47eb3',
'md5-ungz' => '8cf33a880347adb0376b7ab6b5a16dff',
'mtime' => '2008-01-27',
'sha256' => '0dc430f0deded63d47b141e7161e2d0b73fbd6509a03fa97614c8dff79246b21',
'sha256-ungz' => 'b019dfb9f90e91cad36e16c281a9cd63fb0e5fbbb7c21065ca67add4de782bd6',
view all matches for this distribution
view release on metacpan or search on metacpan
=== version history for CPAN::Site
version 1.17: Tue 28 Jun 08:52:03 CEST 2022
Fixes:
- do not run t/20cpan_path.t when there is no network provided
rt.cpan.org#143488 [Slaven Rezic]
Improvements:
- put $VERSION in CPAN::Site
- depends on LWP::Protocol::https [Slaven Rezic]
Improvements:
- this module does not use OODoc for manuals. Remove that from the
README.md
- Sort of packages-list is case-insensitive [Steven Leung]
- Add cpan_path to CHECKSUMS file for modern CPAN clients [Jason McCarver]
version 1.15: Sat Jan 13 23:27:38 CET 2018
Improvements:
- add README.md for GitHUB
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Distribution.pm view on Meta::CPAN
"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;
lib/CPAN/Distribution.pm view on Meta::CPAN
});
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;
lib/CPAN/Distribution.pm view on Meta::CPAN
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;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPANPLUS/Module/Checksums.pm view on Meta::CPAN
#for whole CHECKSUMS file
my $href = $self->_parse_checksums_file( file => $file ) or (
error(loc(q[Could not parse '%1' file], CHECKSUMS)), return );
my $cpan_path = $href->{ $self->package }->{'cpan_path'};
if ( defined $cpan_path ) {
my $chk_pth = join '/', 'authors/id', $cpan_path;
if ( $chk_pth ne $self->path ) {
error(loc( "Archive checksum path for '%1': " .
"should be '%2', but it says it is '%3'. Abandoning.",
$self->package, $self->path, $chk_pth));
return $self->status->checksum_ok(0);
view all matches for this distribution
view release on metacpan or search on metacpan
examples/web/script.js view on Meta::CPAN
$('input[type="search"]').focus();
}
cpan2deb.show_module_info = function (module_name, module_info) {
var module_html = module_name;
var cpan_path_html = 'n/a';
var cpan_version = 'n/a';
var debs = [];
if (module_info[module_name]) {
cpan_path_html = '<a href="http://search.cpan.org/CPAN/authors/id/'+module_info[module_name].CPAN.path+'">'+module_info[module_name].CPAN.path+'</a>';
cpan_version = module_info[module_name].CPAN.version;
module_html = '<a href="http://search.cpan.org/perldoc?'+encodeURIComponent(module_name)+'">'+module_name+'</a>';
if (module_info[module_name].Debian.length == 0) {
debs = [
examples/web/script.js view on Meta::CPAN
);
}
}
$('#cpanModuleName').html(module_html);
$('#cpanPath').html(cpan_path_html);
$('#cpanVersion').text(cpan_version);
$('#debianInfo').html('');
for (i in debs) {
var deb = debs[i];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/CPANTS/ProcessCPAN.pm view on Meta::CPAN
else {
print "new version of $vname\n";
}
print "analyse $vname\n";
my $file=$me->cpan_path_to_dist($dist->prefix);
# call cpants_lint.pl
my $from_lint=`$^X $lint --yaml $file`;
$me->process_yaml($from_lint);
lib/Module/CPANTS/ProcessCPAN.pm view on Meta::CPAN
sub cpan_02packages {
my $me=shift;
return catfile($me->cpan,'modules','02packages.details.txt.gz');
}
sub cpan_path_to_dist {
my $me=shift;
my $prefix=shift;
return catfile($me->cpan,'authors','id',$prefix);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parse/Distname.pm view on Meta::CPAN
# Assume it's a local distribution
$author_dir = "L/LO/LOCAL/";
}
$res{pause_id} = $pause_id;
$res{cpan_path} = "$author_dir$path";
# Now the path should be (subdir/)dist-version
if ($path =~ s!^(.+/)!!) {
$res{subdir} = $1;
lib/Parse/Distname.pm view on Meta::CPAN
=item arg
The path you passed to the function. If what you passed is some kind
of an object (of Path::Tiny, for example), it's stringified.
=item cpan_path
A relative path to the distribution, whose base directory is
assumed CPAN/authors/id/. If org_path doesn't contain a pause_id,
the distribution is assumed to belong to LOCAL user. For example,
say parse_distname('Dist-0.01.tar.gz')->{cpan_path};
# L/LO/LOCAL/Dist-0.01.tar.gz
If you only gives a pause_id, parent directories are supplemented.
say parse_distname('ISHIGAKI/Dist-0.01.tar.gz')->{cpan_path};
# I/IS/ISHIGAKI/Dist-0.01.tar.gz
=item pause_id
The pause_id of the distribution. Contrary to the above, this is
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Perl/Dist/WiX.pm view on Meta::CPAN
if ( $self->cpan()->as_string() =~ m{\Afile://}mxsi ) {
if ( not $CPAN::Config_loaded++ ) {
CPAN::HandleConfig->load();
}
my $cpan_path_from = $CPAN::Config->{'keep_source_where'};
my $cpan_path_to =
rel2abs( catdir( $cpan_path_from, q{..}, 'old_sources' ) );
$self->trace_line( 0, "Moving CPAN sources files:\n" );
$self->trace_line( 2, <<"EOF");
From: $cpan_path_from
To: $cpan_path_to
EOF
File::Copy::Recursive::move( $cpan_path_from, $cpan_path_to );
$self->_set_cpan_sources_from($cpan_path_from);
$self->_set_cpan_sources_to($cpan_path_to);
$self->_move_cpan();
} ## end if ( $self->cpan()->as_string...)
# Do some sanity checks.
if ( $self->cpan()->as_string() !~ m{\/\z}ms ) {
view all matches for this distribution
view release on metacpan or search on metacpan
Pod-Minicpandoc-0.16/Pod-Minicpandoc-0.16/lib/Pod/Minicpandoc.pm view on Meta::CPAN
my $rc_file = File::Spec->catfile((getpwuid $<)[7], '.minicpanrc');
return -e $rc_file;
}
sub get_minicpan_path {
my ( $self ) = @_;
my $rc_file = File::Spec->catfile((getpwuid $<)[7], '.minicpanrc');
my $minicpan_path;
my $fh;
unless(open $fh, '<', $rc_file) {
$self->aside("Unable to open '$rc_file': $!");
return;
}
while(<$fh>) {
chomp;
if(/local:\s*(.*)/) {
$minicpan_path = $1;
last;
}
}
close $fh;
return $minicpan_path;
}
sub find_module_archive {
my ( $self, $module ) = @_;
my $minicpan_path = $self->get_minicpan_path;
unless(defined $minicpan_path) {
$self->aside("Unable to parse minicpan path from .minicpanrc");
return;
}
my $packages = File::Spec->catfile($minicpan_path, 'modules',
'02packages.details.txt.gz');
my $h = IO::Uncompress::Gunzip->new($packages);
my $archive_path;
Pod-Minicpandoc-0.16/Pod-Minicpandoc-0.16/lib/Pod/Minicpandoc.pm view on Meta::CPAN
}
}
close $h;
if($archive_path) {
$archive_path = File::Spec->catfile($minicpan_path, 'authors', 'id',
$archive_path);
}
return $archive_path;
}
view all matches for this distribution
view release on metacpan or search on metacpan
cpan/CPAN/lib/CPAN/Distribution.pm view on Meta::CPAN
"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;
cpan/CPAN/lib/CPAN/Distribution.pm view on Meta::CPAN
});
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;
cpan/CPAN/lib/CPAN/Distribution.pm view on Meta::CPAN
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;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Module/Plan/Base.pm view on Meta::CPAN
# Create internal state variables
$self->{names} = [ ];
$self->{uris} = { };
$self->{dists} = { };
$self->{cpan_path} = { };
# Precalculate the various paths for the P5I file
$self->{p5i_uri} = $self->_p5i_uri( $self->p5i );
$self->{p5i_dir} = $self->_p5i_dir( $self->p5i_uri );
$self->{dir} = File::Temp::tempdir( CLEANUP => 1 );
lib/Module/Plan/Base.pm view on Meta::CPAN
unless ( $file ) {
die("Unknown file $name");
}
# Inject the file into the CPAN cache
$self->{cpan_path}->{$name} = $self->inject->add( file => $file );
1;
}
sub _cpan_install {
my $self = shift;
my $name = shift;
my $distro = $self->{cpan_path}->{$name};
unless ( $distro ) {
die("Unknown file $name");
}
# Install via the CPAN::Shell
view all matches for this distribution