Author: mcummings
Date: 2005-05-11 15:59:01 +0200 (Wed, 11 May 2005)
New Revision: 13
Modified:
code/g-cpan.pl
Log:
Beu's changes - basically so it won't print ./program-name but program-name instead ;). Hmmm...could probably just do this with basename or something instead of the regex cost now that I commit this...
Modified: code/g-cpan.pl
===================================================================
--- code/g-cpan.pl 2005-05-11 10:22:35 UTC (rev 12)
+++ code/g-cpan.pl 2005-05-11 13:59:01 UTC (rev 13)
@@ -41,6 +41,8 @@
# predeclared subs
sub printbig;
+my $prog = $0;
+$prog =~ s|^.*/||;
# Do we need to generate a config ?
eval 'use CPAN::Config;';
@@ -255,7 +257,7 @@
while(my $file = readdir PDIR) {
if(lc $file eq $dir) {
$found = $dir;
- print "$0: Looking for ebuilds in $sdir, found $found so far.\n" if $verbose;
+ print "$prog: Looking for ebuilds in $sdir, found $found so far.\n" if $verbose;
close PDIR;
last SOURCE_FOLDER;
}
@@ -348,7 +350,7 @@
if ( $file =~ m|.*/([a-zA-Z-]*)[0-9]+\.| ) { return $1; }
if ( $file =~ m|.*/([^.]*)\.| ) { return $1; }
- warn "$0: Unable to coerce $file into a portage dir name";
+ warn "$prog: Unable to coerce $file into a portage dir name";
return;
}
@@ -464,7 +466,7 @@
my $file = $obj->cpan_file;
my $dir = portage_dir($obj);
- print "$0: portage_dir returned $dir\n" if ($verbose);
+ print "$prog: portage_dir returned $dir\n" if ($verbose);
unless ($dir) {
warn("Couldn't turn '$file' into a directory name\n");
return;
@@ -546,7 +548,7 @@
my $file = $obj->cpan_file;
my $dir = portage_dir($obj);
- print "$0: portage_dir returned $dir\n" if ($verbose);
+ print "$prog: portage_dir returned $dir\n" if ($verbose);
unless ($dir) {
warn("Couldn't turn '$file' into a directory name\n");
return;
@@ -627,7 +629,7 @@
sub emerge_module {
foreach my $ebuild_name (@ebuild_list) {
$ebuild_name =~ m/.*\/(.*)-[^-]+\./;
- print "$0: emerging $ebuild_name\n";
+ print "$prog: emerging $ebuild_name\n";
# FIXME Sniper
# check return values
system( "emerge", "--oneshot", "--digest", $ebuild_name );
@@ -850,20 +852,20 @@
sub exit_usage {
print <<"USAGE";
-Usage : $0 <Switch(es)> Module Name(s)
+Usage : $prog <Switch(es)> Module Name(s)
--install,-i Try to generate ebuild for the given module name
and, if successful, emerge it. Important : installation
requires exact CPAN Module Name.
--list,-l This command generates a list of the Perl modules and ebuilds
- handled by $0.
+ handled by $prog.
--search,-s Search CPAN for the given expression (similar to
the "m /EXPR/" from the CPAN Shell). Searches are
case insensitive.
---upgrade,-u Try to list and upgrade all Perl modules managed by $0.
+--upgrade,-u Try to list and upgrade all Perl modules managed by $prog.
It generate up-to-date ebuilds, then emerge then.
--verbose,-v Enable (some) verbose output.
--
gentoo-perl@g.o mailing list
|