Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-perl
Navigation:
Lists: gentoo-perl: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-perl@g.o
From: antoine.raillon@...
Subject: r13 - code
Date: Thu, 12 May 2005 23:56:30 +0200 (CEST)
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

Navigation:
Lists: gentoo-perl: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
r12 - / docs
Next by thread:
r14 - code
Previous by date:
r12 - / docs
Next by date:
r14 - code


Updated Jun 17, 2009

Summary: Archive of the gentoo-perl mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.