1 |
Author: mcummings |
2 |
Date: 2005-05-17 18:28:47 +0200 (Tue, 17 May 2005) |
3 |
New Revision: 34 |
4 |
|
5 |
Modified: |
6 |
trunk/bin/g-cpan.pl |
7 |
trunk/extra-docs/Changes |
8 |
trunk/extra-docs/g-cpan.pl.1 |
9 |
Log: |
10 |
Aunty Em, Aunty Em |
11 |
|
12 |
Modified: trunk/bin/g-cpan.pl |
13 |
=================================================================== |
14 |
--- trunk/bin/g-cpan.pl 2005-05-16 12:38:27 UTC (rev 33) |
15 |
+++ trunk/bin/g-cpan.pl 2005-05-17 16:28:47 UTC (rev 34) |
16 |
@@ -57,7 +57,7 @@ |
17 |
Getopt::Long::Configure("bundling"); |
18 |
|
19 |
# Init all options (has to be done to perform the 'sum test' later) |
20 |
-my ( $verbose, $search, $install, $upgrade, $list, $pretend, $ask ) = ( 0, 0, 0, 0, 0, 0, 0 ); |
21 |
+my ( $verbose, $search, $install, $upgrade, $generate, $list, $pretend, $ask ) = ( 0, 0, 0, 0, 0, 0, 0, 0 ); |
22 |
|
23 |
#Get & Parse them |
24 |
GetOptions( |
25 |
@@ -68,12 +68,13 @@ |
26 |
'list|l' => \$list, |
27 |
'pretend|p' => \$pretend, |
28 |
'ask|a' => \$ask, |
29 |
+ 'generate|g' => \$generate, |
30 |
'help|h' => sub { exit_usage(); } |
31 |
) |
32 |
or exit_usage(); |
33 |
|
34 |
# Output error if more than one switch is activated |
35 |
-if ( $search + $list + $install + $upgrade > 1 ) { |
36 |
+if ( $search + $list + $install + $generate + $upgrade > 1 ) { |
37 |
print_err( |
38 |
"You can't combine search, list, install or upgrade with each other. Please choose only one\n"); |
39 |
exit_usage(); |
40 |
@@ -121,11 +122,12 @@ |
41 |
|
42 |
# Assume they gave us module-name instead of module::name |
43 |
# which is bad, because CPAN can't convert it ;p |
44 |
- if ( $expr !~ m|::| ) { |
45 |
- $expr =~ s/-/::/g; |
46 |
- } |
47 |
+ |
48 |
print_ok ("Searching for $expr on CPAN"); |
49 |
- CPAN::Shell->m("/$expr/"); |
50 |
+ unless (CPAN::Shell->i("/$expr/")) { |
51 |
+ $expr =~ s/-/::/g; |
52 |
+ CPAN::Shell->i("/$expr/"); |
53 |
+ } |
54 |
} |
55 |
|
56 |
clean_up(); |
57 |
@@ -218,6 +220,9 @@ |
58 |
my @managed = get_gcpans(); |
59 |
} |
60 |
|
61 |
+if ($generate) { |
62 |
+ install_module($_) for (@ARGV); |
63 |
+} |
64 |
if ($install) { |
65 |
install_module($_) for (@ARGV); |
66 |
emerge_module(); |
67 |
@@ -454,7 +459,7 @@ |
68 |
my $dir = portage_dir($obj); |
69 |
print_info ("$prog: portage_dir returned $dir") if ($verbose); |
70 |
unless ($dir) { |
71 |
- warn("Couldn't turn '$file' into a directory name\n"); |
72 |
+ print_err ("Couldn't turn '$file' into a directory name\n"); |
73 |
return; |
74 |
} |
75 |
|
76 |
@@ -511,12 +516,10 @@ |
77 |
|
78 |
create_ebuild( $obj, $dir, $file, $build_dir, $prereq_pm, $md5string ); |
79 |
|
80 |
- # FIXME Sniper |
81 |
- # OH MY GOD ! |
82 |
unless ( -f "$PORTAGE_DISTDIR/$localfile" ) { |
83 |
move("$localfile", "$PORTAGE_DISTDIR"); |
84 |
} |
85 |
- |
86 |
+ print_info("perl-gcpan/$dir created"); |
87 |
push @ebuild_list, "perl-gcpan/$dir"; |
88 |
} |
89 |
|
90 |
@@ -795,7 +798,9 @@ |
91 |
# IN: 0 scalar pattern sprintf format |
92 |
# x LIST variables filling blank in pattern |
93 |
################################################# |
94 |
-sub fatal { die sprintf(shift, @_) } |
95 |
+sub fatal { my $femfat = sprintf(shift, @_); |
96 |
+ print_err($femfat) and exit(); |
97 |
+ } |
98 |
|
99 |
|
100 |
############## |
101 |
@@ -864,6 +869,9 @@ |
102 |
${green}--ask,-a${reset} |
103 |
Ask before installing |
104 |
|
105 |
+${green}--generate,-g${reset} |
106 |
+ Generate ebuilds only (Requires working overlays) |
107 |
+ |
108 |
${green}--install,-i${reset} |
109 |
Try to generate ebuild for the given module name |
110 |
and, if successful, emerge it. Important : installation |
111 |
|
112 |
Modified: trunk/extra-docs/Changes |
113 |
=================================================================== |
114 |
--- trunk/extra-docs/Changes 2005-05-16 12:38:27 UTC (rev 33) |
115 |
+++ trunk/extra-docs/Changes 2005-05-17 16:28:47 UTC (rev 34) |
116 |
@@ -1,3 +1,9 @@ |
117 |
+17/05/2005 - mcummings |
118 |
+ |
119 |
+- Changed searching to use i() instead of m() (catch more flies with i than m ;) ) |
120 |
+- Modified fatal exist to use cab-colors |
121 |
+- Added generate to create ebuilds for when you don't have perms to emerge |
122 |
+ |
123 |
16/05/2005 - mcummings |
124 |
|
125 |
- Checks for write privs in overlays and choosing the correct overlay based on that |
126 |
|
127 |
Modified: trunk/extra-docs/g-cpan.pl.1 |
128 |
=================================================================== |
129 |
--- trunk/extra-docs/g-cpan.pl.1 2005-05-16 12:38:27 UTC (rev 33) |
130 |
+++ trunk/extra-docs/g-cpan.pl.1 2005-05-17 16:28:47 UTC (rev 34) |
131 |
@@ -4,6 +4,7 @@ |
132 |
.SH SYNOPSIS |
133 |
\fBg-cpan.pl\fR |
134 |
[\ \fB\-a\fR\ | \fB\--ask\fR\ ] |
135 |
+[\ \fB\-g\fR\ | \fB\--generate\fR\ ] |
136 |
[\ \fB\-i\fR\ | \fB\--install\fR\ ] |
137 |
[\ \fB\-l\fR\ | \fB\--list \fR\ ] |
138 |
[\ \fB\-p\fR\ | \fB\--pretend \fR\ ] |
139 |
@@ -46,6 +47,10 @@ |
140 |
.IX Item "-a,--ask" |
141 |
Pass the "ask" argument to portage. This will cause portage to prompt you to confirm your installation prior to issuing an emerge |
142 |
|
143 |
+.IP "\fB\-g,\-\-generate\fR" 4 |
144 |
+.IX Item "-g,--generate" |
145 |
+Generate ebuilds and drop them in the overlay, but never call portage. Useful for generating a tree of ebuilds without having permissions to portage. |
146 |
+ |
147 |
.IP "\fB\-i,\-\-install\fR" 4 |
148 |
.IX Item "-i,--install" |
149 |
Install the (list of) modules provided. |
150 |
@@ -86,6 +91,15 @@ |
151 |
.IP "Upgrading specifc ebuild in overlay from g-cpan" 4 |
152 |
# \fBg-cpan -u Mickey-Mouse\fR |
153 |
|
154 |
+.SH "TODO" |
155 |
+ Todo |
156 |
+ |
157 |
+.SH "SEE ALSO" |
158 |
+.BR emerge (1), |
159 |
+.BR ebuild (5), |
160 |
+.BR make.conf (5), |
161 |
+.BR perl (1) |
162 |
+ |
163 |
.SH "AUTHORS" |
164 |
mcummings <mcummings@g.o> |
165 |
.br |
166 |
|
167 |
|
168 |
-- |
169 |
gentoo-perl@g.o mailing list |