aboutsummaryrefslogtreecommitdiffstats
path: root/cpan2tgz
diff options
context:
space:
mode:
authorJason Woodward2004-11-16 06:08:33 +0000
committerJason Woodward2004-11-16 06:08:33 +0000
commit96fe47214a2883c13e68b71e74c54a0b63e253b4 (patch)
tree52640f05f9f749bb6a5fa5b8300b039d55327dd2 /cpan2tgz
parentac88092082c08b686721217bb0e2360201a08035 (diff)
downloadcpan2tgz-96fe47214a2883c13e68b71e74c54a0b63e253b4.tar.gz
added -ignoreinstalled option, added -recursive option, filled out usage information
Diffstat (limited to 'cpan2tgz')
-rwxr-xr-xcpan2tgz13
1 files changed, 10 insertions, 3 deletions
diff --git a/cpan2tgz b/cpan2tgz
index 7617773..93dbf9d 100755
--- a/cpan2tgz
+++ b/cpan2tgz
@@ -27,11 +27,12 @@ use Data::Dumper;
use Getopt::Long;
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
-my (%PACKAGE_CACHE_LIST,$recursive,$install_after_building);
+my (%PACKAGE_CACHE_LIST,$recursive,$install_after_building,$ignore_installed_deps);
usage() unless
GetOptions(
- "recursive" => \$recursive
+ "recursive" => \$recursive,
+ "ignoreinstalled" => \$ignore_installed_deps,
);
usage() unless (scalar(@ARGV) > 0);
@@ -73,8 +74,11 @@ sub do_package {
if( scalar( keys %{$pack->prereq_pm()} ) > 0 ){
if($recursive){
foreach my $dep ( keys %{$pack->prereq_pm()} ){
+ local $@;
next if defined $PACKAGE_CACHE_LIST{$dep};
print "FIXME: I don't deal with xsloader b/c make ?n/a?\n",next if $dep =~ m/xsloader/i;
+ eval "use $dep;";
+ next if ( $ignore_installed_deps && $@ );
do_package($dep);
}
}else{
@@ -161,7 +165,10 @@ sub do_package {
}
sub usage {
- print "Usage: $0 [options] [modules(s)]\n";
+ print "Jason Woodward <woodwardj at jaos dot org>\n";
+ print "Usage: $0 [option(s)] [modules(s)]\n";
+ print " --recursive build required modules","\n";
+ print " --ignoreinstalled don't build installed required modules","\n";
exit(1);
}