summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2006-05-28 00:00:46 +0000
committerJason Woodward2006-05-28 00:00:46 +0000
commit06fd2d886d697d21edbb7516847de86e6d61acc2 (patch)
treeeb892f57bfa97c392f87081d7be20f3bf84267c4
parent7c8c79363d04fac61f500b3b2896e65c7a3d6ed3 (diff)
downloadcpan2tgz-06fd2d886d697d21edbb7516847de86e6d61acc2.tar.gz
fixed for compatability with older CPAN.pm modules
-rwxr-xr-xcpan2tgz8
1 files changed, 7 insertions, 1 deletions
diff --git a/cpan2tgz b/cpan2tgz
index 11fb1d6..a575774 100755
--- a/cpan2tgz
+++ b/cpan2tgz
@@ -96,7 +96,13 @@ sub do_package
print STDERR "\nFailed to find module: $module_name","\n";
exit(1);
}
- my $pack = $module->distribution;
+
+ my $pack;
+ if ($module->can('distribution')) {
+ $pack = $module->distribution;
+ } else {
+ $pack = $CPAN::META->instance('CPAN::Distribution',$module->cpan_file());
+ }
die "Failed to initialize CPAN::Distribution object for $module_name: $!" unless $pack;
$pack->get(); # go ahead and fetch so we can inspect the source dir for arch info