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