summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2006-04-30 16:45:03 +0000
committerJason Woodward2006-04-30 16:45:03 +0000
commit6e7629d5d392c33d87a34c7775e257665a9f55d2 (patch)
tree7fffe753662c148fd85c82e84d18b6037d5697e6
parent9a6d1a13bff88821c4ad674cc8f15f9df87e4be0 (diff)
downloadcpan2tgz-6e7629d5d392c33d87a34c7775e257665a9f55d2.tar.gz
added --upgrade-all option
-rw-r--r--Changelog3
-rw-r--r--README6
-rwxr-xr-xcpan2tgz18
3 files changed, 23 insertions, 4 deletions
diff --git a/Changelog b/Changelog
index 4cfc410..e5c880d 100644
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,6 @@
-0.5.1 Apr 26, 2006
+0.5.1 Apr 30, 2006
+ * added --upgrade-all option (see docs)
* made --install and --recursive the default, changed options to
--no-install and --no-recursive
* fixed bug with newer CPAN.pm's returning undef from prereq_pm()
diff --git a/README b/README
index 28630c1..03671a0 100644
--- a/README
+++ b/README
@@ -8,6 +8,8 @@ SYNOPSIS
options: [--no-recursive] [--ignoreinstalled] [--no-install] [--pkgdir]
+ cpan2tgz --upgrade-all
+
DESCRIPTION
cpan2tgz is a tool to create Slackware GNU/Linux packages from CPAN
Perl module distributions. cpan2tgz was inspired by cpan2rpm.
@@ -33,6 +35,10 @@ OPTIONS
module((s))
A series of Perl modules to install, ie Data::Dumper
+ --upgrade-all
+ Create packages and install for all outdated modules on the system.
+ Do not pass in module names on the command line.
+
NOTES
cpan2tgz uses the CPAN Perl module. A working CPAN/Config.pm is
assumed. If CPAN has not been initialized prior to running cpan2tgz,
diff --git a/cpan2tgz b/cpan2tgz
index 098ef80..8458e03 100755
--- a/cpan2tgz
+++ b/cpan2tgz
@@ -33,7 +33,7 @@ my (
%PACKAGE_CACHE_LIST, $no_recursive,
$no_install_after_building, $ignore_installed_deps,
$tmp_dir, $package_dir,
- $nobanner
+ $nobanner, $upgrade_all
);
$tmp_dir = "/tmp/";
$package_dir = "/usr/src/";
@@ -45,9 +45,10 @@ usage() unless
"no-install" => \$no_install_after_building,
"pkgdir" => \$package_dir,
"nobanner" => \$nobanner,
+ "upgrade-all" => \$upgrade_all,
);
-usage() unless (scalar(@ARGV) > 0);
+usage() unless (scalar(@ARGV) > 0 || $upgrade_all);
# cache installed packages
if ( opendir(my $pkg_log_dir,"/var/log/packages") ) {
@@ -66,8 +67,12 @@ if ( opendir(my $pkg_log_dir,"/var/log/packages") ) {
}
+my @modules = @ARGV ? @ARGV
+ : $upgrade_all ? CPAN::Shell->r()
+ : ();
+
# now operate on each passed in module unless present in cache
-foreach my $mod ( @ARGV ) {
+foreach my $mod ( @modules ) {
if (! exists $PACKAGE_CACHE_LIST{ "perl-" . $mod} || $ignore_installed_deps) {
do_package($mod);
@@ -297,6 +302,7 @@ sub usage
print " --no-install do NOT install the generated package(s)\n";
print " --pkgdir location to place the generated package(s)\n";
print " --nobanner Leave out the cpan2tgz banner in the description\n";
+ print " --upgrade-all Create packages (and install) for all outdated modules\n";
exit(1);
}
@@ -323,6 +329,8 @@ cpan2tgz [option(s)] [module(s)]
options: [--no-recursive] [--ignoreinstalled] [--no-install] [--pkgdir]
+cpan2tgz --upgrade-all
+
=head1 DESCRIPTION
cpan2tgz is a tool to create Slackware GNU/Linux packages from CPAN Perl module distributions. cpan2tgz was inspired by cpan2rpm.
@@ -351,6 +359,10 @@ This option specifies the final location to place the generated package(s). Def
A series of Perl modules to install, ie Data::Dumper
+=item B<--upgrade-all>
+
+Create packages and install for all outdated modules on the system. Do not pass in module names on the command line.
+
=head1 NOTES
cpan2tgz uses the CPAN Perl module. A working CPAN/Config.pm is assumed. If CPAN has not been initialized prior to running cpan2tgz, it will be initialized on the first run.