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: r34 - in trunk: bin extra-docs
Date: Tue, 17 May 2005 18:28:48 +0200 (CEST)
Author: mcummings
Date: 2005-05-17 18:28:47 +0200 (Tue, 17 May 2005)
New Revision: 34

Modified:
   trunk/bin/g-cpan.pl
   trunk/extra-docs/Changes
   trunk/extra-docs/g-cpan.pl.1
Log:
Aunty Em, Aunty Em

Modified: trunk/bin/g-cpan.pl
===================================================================
--- trunk/bin/g-cpan.pl	2005-05-16 12:38:27 UTC (rev 33)
+++ trunk/bin/g-cpan.pl	2005-05-17 16:28:47 UTC (rev 34)
@@ -57,7 +57,7 @@
 Getopt::Long::Configure("bundling");
 
 # Init all options (has to be done to perform the 'sum test' later)
-my ( $verbose, $search, $install, $upgrade, $list, $pretend, $ask  ) = ( 0, 0, 0, 0, 0, 0, 0 );
+my ( $verbose, $search, $install, $upgrade, $generate, $list, $pretend, $ask  ) = ( 0, 0, 0, 0, 0, 0, 0, 0 );
 
 #Get & Parse them
 GetOptions(
@@ -68,12 +68,13 @@
     'list|l'    => \$list,
     'pretend|p' => \$pretend,
     'ask|a'     => \$ask,
+    'generate|g'   => \$generate,
     'help|h'    => sub { exit_usage(); }
   )
   or exit_usage();
 
 # Output error if more than one switch is activated
-if ( $search + $list + $install + $upgrade > 1 ) {
+if ( $search + $list + $install + $generate + $upgrade > 1 ) {
     print_err(
 "You can't combine search, list, install or upgrade with each other. Please choose only one\n");
     exit_usage();
@@ -121,11 +122,12 @@
 
         # Assume they gave us module-name instead of module::name
         # which is bad, because CPAN can't convert it ;p
-        if ( $expr !~ m|::| ) {
-            $expr =~ s/-/::/g;
-        }
+
         print_ok ("Searching for $expr on CPAN");
-        CPAN::Shell->m("/$expr/");
+        unless (CPAN::Shell->i("/$expr/")) {
+		$expr =~ s/-/::/g;
+		CPAN::Shell->i("/$expr/");
+	}
     }
 
     clean_up();
@@ -218,6 +220,9 @@
     my @managed = get_gcpans();
 }
 
+if ($generate) {
+    install_module($_) for (@ARGV);
+}
 if ($install) {
     install_module($_) for (@ARGV);
     emerge_module();
@@ -454,7 +459,7 @@
     my $dir  = portage_dir($obj);
     print_info ("$prog: portage_dir returned $dir") if ($verbose);
     unless ($dir) {
-        warn("Couldn't turn '$file' into a directory name\n");
+        print_err ("Couldn't turn '$file' into a directory name\n");
         return;
     }
 
@@ -511,12 +516,10 @@
 
     create_ebuild( $obj, $dir, $file, $build_dir, $prereq_pm, $md5string );
 
-    # FIXME Sniper
-    # OH MY GOD !
     unless ( -f "$PORTAGE_DISTDIR/$localfile" ) {
        move("$localfile", "$PORTAGE_DISTDIR");
     }
-
+    print_info("perl-gcpan/$dir created");
     push @ebuild_list, "perl-gcpan/$dir";
 }
 
@@ -795,7 +798,9 @@
 # IN: 0 scalar pattern sprintf format
 #     x LIST   variables filling blank in pattern
 #################################################
-sub fatal { die sprintf(shift, @_) }
+sub fatal { my $femfat =  sprintf(shift, @_);
+	print_err($femfat) and exit();
+ }
 
 
 ##############
@@ -864,6 +869,9 @@
 ${green}--ask,-a${reset}
     Ask before installing
 
+${green}--generate,-g${reset}
+    Generate ebuilds only (Requires working overlays)
+
 ${green}--install,-i${reset}
     Try to generate ebuild for the given module name
     and, if successful, emerge it. Important : installation

Modified: trunk/extra-docs/Changes
===================================================================
--- trunk/extra-docs/Changes	2005-05-16 12:38:27 UTC (rev 33)
+++ trunk/extra-docs/Changes	2005-05-17 16:28:47 UTC (rev 34)
@@ -1,3 +1,9 @@
+17/05/2005 - mcummings
+
+- Changed searching to use i() instead of m() (catch more flies with i than m ;) )
+- Modified fatal exist to use cab-colors
+- Added generate to create ebuilds for when you don't have perms to emerge
+
 16/05/2005 - mcummings
 
 - Checks for write privs in overlays and choosing the correct overlay based on that

Modified: trunk/extra-docs/g-cpan.pl.1
===================================================================
--- trunk/extra-docs/g-cpan.pl.1	2005-05-16 12:38:27 UTC (rev 33)
+++ trunk/extra-docs/g-cpan.pl.1	2005-05-17 16:28:47 UTC (rev 34)
@@ -4,6 +4,7 @@
 .SH SYNOPSIS
 \fBg-cpan.pl\fR 
 [\ \fB\-a\fR\ | \fB\--ask\fR\ ] 
+[\ \fB\-g\fR\ | \fB\--generate\fR\ ] 
 [\ \fB\-i\fR\ | \fB\--install\fR\ ] 
 [\ \fB\-l\fR\ | \fB\--list \fR\ ] 
 [\ \fB\-p\fR\ | \fB\--pretend \fR\ ]
@@ -46,6 +47,10 @@
 .IX Item "-a,--ask"
 Pass the "ask" argument to portage. This will cause portage to prompt you to confirm your installation prior to issuing an emerge
 
+.IP "\fB\-g,\-\-generate\fR" 4
+.IX Item "-g,--generate"
+Generate ebuilds and drop them in the overlay, but never call portage. Useful for generating a tree of ebuilds without having permissions to portage.
+
 .IP "\fB\-i,\-\-install\fR" 4
 .IX Item "-i,--install"
 Install the (list of) modules provided.
@@ -86,6 +91,15 @@
 .IP "Upgrading specifc ebuild in overlay from g-cpan" 4
 # \fBg-cpan -u Mickey-Mouse\fR
 
+.SH "TODO"
+	Todo
+
+.SH "SEE ALSO"
+.BR emerge (1),
+.BR ebuild (5),
+.BR make.conf (5),
+.BR perl (1)
+
 .SH "AUTHORS"
 mcummings <mcummings@g.o>
 .br


-- 
gentoo-perl@g.o mailing list

Navigation:
Lists: gentoo-perl: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
r33 - in trunk: bin extra-docs
Next by thread:
mod_perl2
Previous by date:
Re: Réf. : Re: Réf. : Re: Réf. : [gentoo-perl] r33 - in trunk: bin extra-docs
Next by date:
mod_perl2


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.