summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2006-05-18 02:42:31 +0000
committerJason Woodward2006-05-18 02:42:31 +0000
commit7b5b992f8073d8e183e984b726aa1f8dddee2ce1 (patch)
treee41710a68b7a3bb5314e3f52c1197b3d0b61293d
parent6e7629d5d392c33d87a34c7775e257665a9f55d2 (diff)
downloadcpan2tgz-7b5b992f8073d8e183e984b726aa1f8dddee2ce1.tar.gz
put the modules unpacked directory (along with ./lib) into Perl's include path and added --build-tag option (see docs)
-rw-r--r--Changelog5
-rwxr-xr-xcpan2tgz23
2 files changed, 23 insertions, 5 deletions
diff --git a/Changelog b/Changelog
index e5c880d..f47824e 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,9 @@
+0.5.2 May 17, 2006
+ * put the modules unpacked directory (along with ./lib)
+ into Perl's include path
+ * added --build-tag option (see docs)
+
0.5.1 Apr 30, 2006
* added --upgrade-all option (see docs)
* made --install and --recursive the default, changed options to
diff --git a/cpan2tgz b/cpan2tgz
index 8458e03..8defe87 100755
--- a/cpan2tgz
+++ b/cpan2tgz
@@ -26,14 +26,15 @@ use Config;
use CPAN;
use Getopt::Long;
-our $VERSION = "0.5.1";
+our $VERSION = "0.5.2";
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
my (
%PACKAGE_CACHE_LIST, $no_recursive,
$no_install_after_building, $ignore_installed_deps,
$tmp_dir, $package_dir,
- $nobanner, $upgrade_all
+ $nobanner, $upgrade_all,
+ $build_tag
);
$tmp_dir = "/tmp/";
$package_dir = "/usr/src/";
@@ -43,10 +44,12 @@ usage() unless
"no-recursive" => \$no_recursive,
"ignoreinstalled" => \$ignore_installed_deps,
"no-install" => \$no_install_after_building,
- "pkgdir" => \$package_dir,
+ "pkgdir=s" => \$package_dir,
"nobanner" => \$nobanner,
"upgrade-all" => \$upgrade_all,
+ "build-tag=s" => \$build_tag,
);
+$build_tag ||= q[];
usage() unless (scalar(@ARGV) > 0 || $upgrade_all);
@@ -103,7 +106,7 @@ sub do_package
} else {
$pkg_name .= "-noarch";
}
- $pkg_name .= "-1.tgz";
+ $pkg_name .= "-1$build_tag.tgz";
my $dest_dir = $tmp_dir . '/' . $module->id();
@@ -126,6 +129,12 @@ sub do_package
my $pack = $CPAN::META->instance('CPAN::Distribution',$module->cpan_file());
die "Failed to initialize CPAN::Distribution object for $module_name: $!" unless $pack;
+ # add the modules unpacked directory to the library search path
+ push @INC, $pack->dir();
+ if ( -d $pack->dir() . '/lib' ) {
+ push @INC, $pack->dir() . '/lib';
+ }
+
if ( $pack->isa_perl() ) {
print STDERR "\nWill not install ",$module->id(),
" because it is contained within Perl proper.\n";
@@ -327,7 +336,7 @@ cpan2tgz - create Slackware GNU/Linux packages from CPAN Perl module distributio
cpan2tgz [option(s)] [module(s)]
-options: [--no-recursive] [--ignoreinstalled] [--no-install] [--pkgdir]
+options: [--no-recursive] [--ignoreinstalled] [--no-install] [--pkgdir] [--build-tag]
cpan2tgz --upgrade-all
@@ -363,6 +372,10 @@ A series of Perl modules to install, ie Data::Dumper
Create packages and install for all outdated modules on the system. Do not pass in module names on the command line.
+=item B<--build-tag>
+
+Set the package's build tag, foo-0.1-arch-1buildtag.tgz.
+
=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.