aboutsummaryrefslogtreecommitdiffstats
path: root/cpan2tgz
diff options
context:
space:
mode:
authorJason Woodward2004-11-17 18:21:30 +0000
committerJason Woodward2004-11-17 18:21:30 +0000
commit710a17a5d65793bb7bf5b3dc224c427bdc6cc964 (patch)
tree2ca746e5acd46d49309ae0cf5496edac5d93d3ec /cpan2tgz
parentcbe971349e8d5dcb49ccd73ed16c222cc230a558 (diff)
downloadcpan2tgz-710a17a5d65793bb7bf5b3dc224c427bdc6cc964.tar.gz
-recursive now only installs the module when --install is specified. inverted meaning of ignoreinstalled, so now ignoreinstalled will build up to date packages for modules already present on the system. added check to skip dependency when required module is contained within the Perl source.
Diffstat (limited to 'cpan2tgz')
-rwxr-xr-xcpan2tgz19
1 files changed, 14 insertions, 5 deletions
diff --git a/cpan2tgz b/cpan2tgz
index 9584a70..86c0c3a 100755
--- a/cpan2tgz
+++ b/cpan2tgz
@@ -75,6 +75,10 @@ sub do_package {
# do an initial make so that we can get the dep info
my $pack = $CPAN::META->instance('CPAN::Distribution',$module->cpan_file());
die "Failed to initialize CPAN::Distribution object for $module_name: $!" unless $pack;
+ if( $pack->isa_perl() ){
+ print STDERR "\nWill not install ",$module->id()," because it is contained within Perl proper.\n";
+ return;
+ }
eval { $pack->make() or die $!; };
if( $@ ){
print "make ERROR [$module_name]: $!\n";
@@ -84,10 +88,15 @@ sub do_package {
my @deps;
if( $ignore_installed_deps ){
# only get the deps that are not installed
- @deps = grep { m/\w+/; } map { eval "no warnings 'all'; use $_;"; if($@){ $_ } } keys %{$pack->prereq_pm()};
+ @deps = grep { $_ && m/\w+/; }
+ map { if($PACKAGE_CACHE_LIST{$_}){undef}else{$_} }
+ keys %{$pack->prereq_pm()};
}else{
# get all dependencies
- @deps = keys %{$pack->prereq_pm()};
+ @deps = grep { $_ && m/\w+/; }
+ map { if($PACKAGE_CACHE_LIST{$_}){undef}else{$_} }
+ map { eval "no warnings 'all'; use $_;"; if($@){ $_ } }
+ keys %{$pack->prereq_pm()};
}
# look at module prerequisites
if( @deps > 0 ){
@@ -205,7 +214,7 @@ SCRIPT
die "Failed to build package $pkg_name: $!" unless ( -f "/usr/src/$pkg_name" );
# install the package
- if( $recursive or $install_after_building ){
+ if( $install_after_building ){
system("installpkg /usr/src/$pkg_name");
}
@@ -262,11 +271,11 @@ Download the package only. Do not install/upgrade. Packages are downloaded to
=item B<--ignoreinstalled>
-This option specifies not to build packages for required modules if the module is found to be present and installed on the system. This only works in conjunction with --recursive.
+This option specifies to build packages for required modules even if the module is found to be present and installed on the system. This only works in conjunction with --recursive.
=item B<--install>
-Always install the generated package. This is the default behavior with --recursive.
+Always install the generated package. This is useful with --recursive to satisfy dependencies.
=item B<module(s)>