CPAN-Site

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN


=== 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]

version 1.16: Thu 23 Jun 10:57:25 CEST 2022

	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
	- clarify license
	- update some references to newer preference.

version 1.14: Thu 26 Jan 12:57:46 CET 2017

MANIFEST  view on Meta::CPAN

MANIFEST
Makefile.PL
README
bin/cpansite
explain_101.txt
lib/CPAN/Site.pm
lib/CPAN/Site.pod
lib/CPAN/Site/Index.pm
t/10index.t
t/20qv.t
t/30cpan_path.t
t/test_data/Distro-With-Multi-Package-Module.tar.gz
t/test_data/Distro-With-Packages-Outside-lib.tar.gz
t/test_data/Text-PDF-0.29a.tar.gz
xt/99pod.t
META.yml                                 Module YAML meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)

t/30cpan_path.t  view on Meta::CPAN

#!/usr/bin/env perl
# Verify generated CHECKCUMS has an appropriate 'cpan_path' member
#-------------------------------------------------------------------------------
use strict;
use warnings;

use Test::More;

# This tests attempts to load the maintainers file from cpan,
# which is blocked by cpantesters... which makes all its nice
# regression tests fail.
plan skip_all => "Running in cpantesters"

t/30cpan_path.t  view on Meta::CPAN

use Test::TempDir::Tiny   qw(tempdir);
use File::Spec::Functions qw(catdir catfile);
use File::Path            qw(make_path);
use File::Copy            qw(copy);

# use Log::Report 'cpan-site', mode => 'DEBUG';

use_ok 'CPAN::Site::Index';
CPAN::Site::Index->import('cpan_index');

test_cpan_path_generation();

exit;

#-------------------------------------------------------------------------------

sub test_cpan_path_generation {
    my $distro = 'Distro-With-Multi-Package-Module.tar.gz';

    my $tmpdir = tempdir();
    $tmpdir && -d $tmpdir or die "Something went horribly wrong!";

    my $mycpan  = catdir($tmpdir, 'site');
    my $distdir = catdir($mycpan, qw(authors id L LO LOCAL));

    make_path($distdir)
        or return diag "Failed to create temp directory";

t/30cpan_path.t  view on Meta::CPAN


    read $fh, my $cksum, -s $fh
        or return diag "Failed to read CHECKSUMS";
    close $fh;

    $cksum = eval $cksum
        or return diag "Failed to eval CHECKSUMS";

    isa_ok $cksum, 'HASH';
	isa_ok $cksum->{$distro}, 'HASH';
    is +($cksum->{$distro}->{cpan_path} // ''), 'L/LO/LOCAL';
}



( run in 0.546 second using v1.01-cache-2.11-cpan-f79bc02f770 )