Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: timbunce/Dist-Surveyor
base: a8669a7823
head fork: timbunce/Dist-Surveyor
compare: 27af67445b
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 28 additions and 24 deletions.
  1. +12 −9 bin/dist_surveyor
  2. +16 −15 lib/Dist/
21 bin/dist_surveyor
@@ -83,20 +83,23 @@ It's important to give the correct perl lib directory path.
It's important to check the results related to any modules that generated
warnings during the run.
-Install those distributions into a new library:
+Then, to install those distributions into a new library:
- cpanm --mirror file:$PWD/my_cpan [--mirror-only] -l new_lib < installed_dists.txt
+ cpanm --mirror file:$PWD/my_cpan --mirror-only [-l new_lib] < installed_dists.txt
-That will always reinstall all the listed distributions. If some distributions
-fail to install (typically due to test failures) then it's I<much> faster to use the
-'token package list' on later runs:
+It's very likely that some distributions will fail tests and not install,
+which will, in turn, cause others to fail. Once the initial run is complete
+study the cpam build log file carefully and resolve the test failures.
- cpanm --mirror file:$PWD/my_cpan [--mirror-only] -l new_lib < my_cpan/dist_surveyor/token_packages.txt
+Running cpanm with a list of distributions, as above, will always reinstall
+I<all> the listed distributions. Even those already sucessfully installed.
-Using package name allows cpanm to skip those that it knows are already installed.
+It's much (I<much>) faster to give cpanm a list of package names as that allows
+it to skip those that it knows are already installed. The L</--makecpan> option
+writes a list of 'token packages', one per distribution, so you can use that
+with cpanm:
-When using dist_surveyor to migrate perl versions, use the old perl to run
-dist_surveyor and the new perl to run cpanm.
+ cpanm --mirror file:$PWD/my_cpan --mirror-only [-l new_lib] < my_cpan/dist_surveyor/token_packages.txt
=head1 BUGS
31 lib/Dist/
@@ -110,8 +110,8 @@ for my $subname (keys %memoize_subs) {
# for distros with names that don't match the principle module name
# yet the principle module version always matches the distro
-# Used for perllocal.pod lookups
-# # XXX should be automated lookup rather than hardcoded
+# Used for perllocal.pod lookups and for picking 'token packages' for minicpan
+# # XXX should be automated lookup rather than hardcoded (else remove perllocal.pod parsing)
my %distro_key_mod_names = (
'PathTools' => 'File::Spec',
'Template-Toolkit' => 'Template',
@@ -123,22 +123,23 @@ my %distro_key_mod_names = (
sub main {
-# give only top-level lib dir, the archlib will be added automatically
-die "Usage: $0 perl-lib-directory\n"
+die "Usage: $0 perl-lib-directory [...]\n"
unless @ARGV;
-my @libdir = @ARGV;
-die "$libdir[0] isn't a directory\n" unless -d $libdir[0];
-my $archdir = "$libdir[0]/$Config{archname}";
-if (-d $archdir) {
- unshift @libdir, $archdir;
-else {
- warn "No $Config{archname} directory in $libdir[0].\n";
- warn "This probably means you've given the wrong directory\n";
- warn "(or that you're using the wrong perl build).\n";
+my @libdirs = @ARGV;
+# check dirs and add archlib's if appropriate
+for my $libdir (@libdirs) {
+ die "$libdir isn't a directory\n"
+ unless -d $libdir;
+ my $archdir = "$libdir/$Config{archname}";
+ if (-d $archdir) {
+ unshift @libdirs, $archdir
+ unless grep { $_ eq $archdir } @libdirs;
+ }
-my @installed_releases = determine_installed_releases(@libdir);
+my @installed_releases = determine_installed_releases(@libdirs);
write_fields(\@installed_releases, $opt_format, [split ' ', $opt_output], \*STDOUT);
warn sprintf "Completed survey in %.1f minutes using %d metacpan calls.\n",

No commit comments for this range

Something went wrong with that request. Please try again.