1 |
Author: zmedico |
2 |
Date: 2009-04-01 01:49:22 +0000 (Wed, 01 Apr 2009) |
3 |
New Revision: 13267 |
4 |
|
5 |
Modified: |
6 |
main/trunk/man/emerge.1 |
7 |
main/trunk/pym/_emerge/__init__.py |
8 |
main/trunk/pym/_emerge/help.py |
9 |
Log: |
10 |
Combine the --rdeps-only and --root-deps options into a single --root-deps |
11 |
option which takes an optional 'rdeps' argument. |
12 |
|
13 |
|
14 |
Modified: main/trunk/man/emerge.1 |
15 |
=================================================================== |
16 |
--- main/trunk/man/emerge.1 2009-04-01 00:08:06 UTC (rev 13266) |
17 |
+++ main/trunk/man/emerge.1 2009-04-01 01:49:22 UTC (rev 13267) |
18 |
@@ -414,13 +414,6 @@ |
19 |
Results may vary, but the general outcome is a reduced or condensed |
20 |
output from portage's displays. |
21 |
.TP |
22 |
-.BR "\-\-rdeps\-only" |
23 |
-Discard all build\-time dependencies. This option is commonly used together |
24 |
-with \fBROOT\fR and it should not be enabled under normal circumstances. For |
25 |
-currently supported \fBEAPI\fR values, the dependencies specified in the |
26 |
-\fBDEPEND\fR variable are discarded. However, behavior may change for new |
27 |
-\fBEAPI\fRs when related extensions are added in the future. |
28 |
-.TP |
29 |
.BR "\-\-reinstall changed\-use" |
30 |
Tells emerge to include installed packages where USE flags have |
31 |
changed since installation. Unlike \fB\-\-newuse\fR, this option does |
32 |
@@ -430,11 +423,14 @@ |
33 |
.BR \-\-root=DIR |
34 |
Set the \fBROOT\fR environment variable. |
35 |
.TP |
36 |
-.BR "\-\-root\-deps" |
37 |
-Install build\-time dependencies to \fBROOT\fR instead of /. This option |
38 |
-should not be enabled under normal circumstances. For currently supported |
39 |
-\fBEAPI\fR values, the dependencies specified in the \fBDEPEND\fR variable |
40 |
-are used. However, behavior may change for new |
41 |
+.BR "\-\-root\-deps[=rdeps]" |
42 |
+If no argument is given then build\-time dependencies are installed to |
43 |
+\fBROOT\fR instead of /. If the \fBrdeps\fR argument is given then discard |
44 |
+all build\-time dependencies of packages for \fBROOT\fR. This option is |
45 |
+only meaningful when used together with \fBROOT\fR and it should not |
46 |
+be enabled under normal circumstances. For currently supported |
47 |
+\fBEAPI\fR values, the build-time dependencies are specified in the |
48 |
+\fBDEPEND\fR variable. However, behavior may change for new |
49 |
\fBEAPI\fRs when related extensions are added in the future. |
50 |
.TP |
51 |
.BR "\-\-skipfirst" |
52 |
|
53 |
Modified: main/trunk/pym/_emerge/__init__.py |
54 |
=================================================================== |
55 |
--- main/trunk/pym/_emerge/__init__.py 2009-04-01 00:08:06 UTC (rev 13266) |
56 |
+++ main/trunk/pym/_emerge/__init__.py 2009-04-01 01:49:22 UTC (rev 13267) |
57 |
@@ -207,7 +207,6 @@ |
58 |
"--nospinner", "--oneshot", |
59 |
"--onlydeps", "--pretend", |
60 |
"--quiet", "--resume", |
61 |
-"--rdeps-only", "--root-deps", |
62 |
"--searchdesc", "--selective", |
63 |
"--skipfirst", |
64 |
"--tree", |
65 |
@@ -5277,9 +5276,11 @@ |
66 |
|
67 |
bdeps_root = "/" |
68 |
if self.target_root != "/": |
69 |
- if "--root-deps" in self.myopts: |
70 |
+ root_deps = self.myopts.get("--root-deps") |
71 |
+ if root_deps is not None: |
72 |
+ if root_deps is True: |
73 |
bdeps_root = myroot |
74 |
- if "--rdeps-only" in self.myopts: |
75 |
+ elif root_deps == "rdeps": |
76 |
bdeps_root = "/" |
77 |
edepend["DEPEND"] = "" |
78 |
|
79 |
@@ -14769,11 +14770,22 @@ |
80 |
|
81 |
new_args = [] |
82 |
jobs_opts = ("-j", "--jobs") |
83 |
+ root_deps_opt = '--root-deps' |
84 |
+ root_deps_choices = ('True', 'rdeps') |
85 |
arg_stack = args[:] |
86 |
arg_stack.reverse() |
87 |
while arg_stack: |
88 |
arg = arg_stack.pop() |
89 |
|
90 |
+ if arg == root_deps_opt: |
91 |
+ new_args.append(arg) |
92 |
+ if arg_stack and arg_stack[-1] in root_deps_choices: |
93 |
+ new_args.append(arg_stack.pop()) |
94 |
+ else: |
95 |
+ # insert default argument |
96 |
+ new_args.append('True') |
97 |
+ continue |
98 |
+ |
99 |
short_job_opt = bool("j" in arg and arg[:1] == "-" and arg[:2] != "--") |
100 |
if not (short_job_opt or arg in jobs_opts): |
101 |
new_args.append(arg) |
102 |
@@ -14866,6 +14878,12 @@ |
103 |
"help" : "specify the target root filesystem for merging packages", |
104 |
"action" : "store" |
105 |
}, |
106 |
+ |
107 |
+ "--root-deps": { |
108 |
+ "help" : "modify interpretation of depedencies", |
109 |
+ "type" : "choice", |
110 |
+ "choices" :("True", "rdeps") |
111 |
+ }, |
112 |
} |
113 |
|
114 |
from optparse import OptionParser |
115 |
@@ -14894,6 +14912,9 @@ |
116 |
|
117 |
myoptions, myargs = parser.parse_args(args=tmpcmdline) |
118 |
|
119 |
+ if myoptions.root_deps == "True": |
120 |
+ myoptions.root_deps = True |
121 |
+ |
122 |
if myoptions.jobs: |
123 |
jobs = None |
124 |
if myoptions.jobs == "True": |
125 |
|
126 |
Modified: main/trunk/pym/_emerge/help.py |
127 |
=================================================================== |
128 |
--- main/trunk/pym/_emerge/help.py 2009-04-01 00:08:06 UTC (rev 13266) |
129 |
+++ main/trunk/pym/_emerge/help.py 2009-04-01 01:49:22 UTC (rev 13267) |
130 |
@@ -410,15 +410,6 @@ |
131 |
print " Effects vary, but the general outcome is a reduced or condensed" |
132 |
print " output from portage's displays." |
133 |
print |
134 |
- print " "+green("--rdeps-only") |
135 |
- desc = "Discard all build-time dependencies. This option is commonly used together " + \ |
136 |
- "with ROOT and it should not be enabled under normal circumstances. For " + \ |
137 |
- "currently supported EAPI values, the dependencies specified in the " + \ |
138 |
- "DEPEND variable are discarded. However, behavior may change for new " + \ |
139 |
- "EAPIs when related extensions are added in the future." |
140 |
- for line in wrap(desc, desc_width): |
141 |
- print desc_indent + line |
142 |
- print |
143 |
print " "+green("--reinstall ") + turquoise("changed-use") |
144 |
print " Tells emerge to include installed packages where USE flags have" |
145 |
print " changed since installation. Unlike --newuse, this option does" |
146 |
@@ -431,11 +422,14 @@ |
147 |
for line in wrap(desc, desc_width): |
148 |
print desc_indent + line |
149 |
print |
150 |
- print " "+green("--root-deps") |
151 |
- desc = "Install build-time dependencies to ROOT instead of /. This option " + \ |
152 |
- "should not be enabled under normal circumstances. For currently supported " + \ |
153 |
- "EAPI values, the dependencies specified in the DEPEND variable " + \ |
154 |
- "are used. However, behavior may change for new " + \ |
155 |
+ print " "+green("--root-deps[=rdeps]") |
156 |
+ desc = "If no argument is given then build-time dependencies are installed to " + \ |
157 |
+ "ROOT instead of /. If the rdeps argument is given then discard " + \ |
158 |
+ "all build-time dependencies of packages for ROOT. This option is " + \ |
159 |
+ "only meaningful when used together with ROOT and it should not " + \ |
160 |
+ "be enabled under normal circumstances. For currently supported " + \ |
161 |
+ "EAPI values, the build-time dependencies are specified in the " + \ |
162 |
+ "DEPEND variable. However, behavior may change for new " + \ |
163 |
"EAPIs when related extensions are added in the future." |
164 |
for line in wrap(desc, desc_width): |
165 |
print desc_indent + line |