Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r14501 - in main/trunk: man pym/_emerge
Date: Tue, 06 Oct 2009 06:57:08
Message-Id: E1Mv3ys-0000mX-Mn@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-10-06 06:57:06 +0000 (Tue, 06 Oct 2009)
3 New Revision: 14501
4
5 Modified:
6 main/trunk/man/emerge.1
7 main/trunk/man/make.conf.5
8 main/trunk/pym/_emerge/help.py
9 main/trunk/pym/_emerge/main.py
10 Log:
11 Add a new --accept-properties option so that users can temporarily override
12 ACCEPT_PROPERTIES on the commandline, without relying on emerge's legacy
13 behavior of allowing variables to leak in from the calling environment.
14 A typical usage example for this option would be to use
15 --accept-properties=-interactive to temporarily mask interactive packages.
16 With default configuration, this would result in an effective
17 ACCEPT_PROPERTIES value of "* -interactive".
18
19
20 Modified: main/trunk/man/emerge.1
21 ===================================================================
22 --- main/trunk/man/emerge.1 2009-10-06 06:10:07 UTC (rev 14500)
23 +++ main/trunk/man/emerge.1 2009-10-06 06:57:06 UTC (rev 14501)
24 @@ -234,6 +234,20 @@
25 Displays the version number of \fBemerge\fR.
26 .SH "OPTIONS"
27 .TP
28 +.BR \-\-accept\-properties=ACCEPT_PROPERTIES
29 +This option temporarily overrides the \fBACCEPT_PROPERTIES\fR
30 +variable. The \fBACCEPT_PROPERTIES\fR variable is incremental,
31 +which means that the specified setting is appended to the
32 +existing value from your configuration. The special \fB-*\fR
33 +token can be used to discard the existing configuration
34 +value and start fresh. See the \fBMASKED PACKAGES\fR section
35 +and \fBmake.conf\fR(5) for more information about
36 +ACCEPT_PROPERTIES. A typical usage example for this option
37 +would be to use \fI\-\-accept\-properties=-interactive\fR to
38 +temporarily mask interactive packages. With default
39 +configuration, this would result in an effective
40 +\fBACCEPT_PROPERTIES\fR value of "* -interactive".
41 +.TP
42 .BR "\-\-alphabetical "
43 When displaying USE and other flag output, combines the enabled and
44 disabled lists into one list and sorts the whole list alphabetically.
45 @@ -667,7 +681,8 @@
46 \fBACCEPT_PROPERTIES\fR environment variable to allow or disallow the emerging
47 of a package masked by \fBPROPERTIES\fR. See \fBmake.conf\fR(5) for information
48 about \fBACCEPT_PROPERTIES\fR, and see \fBportage\fR(5) for information about
49 -\fI/etc/portage/package.properties\fR.
50 +\fI/etc/portage/package.properties\fR. Use the \fB\-\-accept\-properties\fR
51 +option to temporarily override \fBACCEPT_PROPERTIES\fR.
52 .SH "CONFIGURATION FILES"
53 Portage has a special feature called "config file protection". The purpose of
54 this feature is to prevent new package installs from clobbering existing
55
56 Modified: main/trunk/man/make.conf.5
57 ===================================================================
58 --- main/trunk/man/make.conf.5 2009-10-06 06:10:07 UTC (rev 14500)
59 +++ main/trunk/man/make.conf.5 2009-10-06 06:57:06 UTC (rev 14501)
60 @@ -43,7 +43,9 @@
61 .TP
62 \fBACCEPT_PROPERTIES\fR = \fI[space delimited list of properties]\fR
63 This variable is used to mask packages based on PROPERTIES restrictions.
64 -See \fBebuild\fR(5) for more information about PROPERTIES.
65 +This varable can be temporarily overridden using the the
66 +\fB\-\-accept\-properties\fR option of \fBemerge\fR(1).
67 +See \fBebuild\fR(5) for more information about PROPERTIES.
68 .br
69 Defaults to the value of *.
70 .TP
71
72 Modified: main/trunk/pym/_emerge/help.py
73 ===================================================================
74 --- main/trunk/pym/_emerge/help.py 2009-10-06 06:10:07 UTC (rev 14500)
75 +++ main/trunk/pym/_emerge/help.py 2009-10-06 06:57:06 UTC (rev 14501)
76 @@ -232,6 +232,22 @@
77 print(" "+bold("emerge info")+" for more advanced information.")
78 print()
79 print(turquoise("Options:"))
80 + print(" "+green("--accept-properties=ACCEPT_PROPERTIES"))
81 + desc = "This option temporarily overrides the ACCEPT_PROPERTIES " + \
82 + "variable. The ACCEPT_PROPERTIES variable is incremental, " + \
83 + "which means that the specified setting is appended to the " + \
84 + "existing value from your configuration. The special -* " + \
85 + "token can be used to discard the existing configuration " + \
86 + "value and start fresh. See the MASKED PACKAGES section " + \
87 + "and make.conf(5) for more information about " + \
88 + "ACCEPT_PROPERTIES. A typical usage example for this option " + \
89 + "would be to use --accept-properties=-interactive to " + \
90 + "temporarily mask interactive packages. With default " + \
91 + "configuration, this would result in an effective " + \
92 + "ACCEPT_PROPERTIES value of \"* -interactive\"."
93 + for line in wrap(desc, desc_width):
94 + print(desc_indent + line)
95 + print()
96 print(" "+green("--alphabetical"))
97 print(" When displaying USE and other flag output, combines the enabled")
98 print(" and disabled flags into a single list and sorts it alphabetically.")
99
100 Modified: main/trunk/pym/_emerge/main.py
101 ===================================================================
102 --- main/trunk/pym/_emerge/main.py 2009-10-06 06:10:07 UTC (rev 14500)
103 +++ main/trunk/pym/_emerge/main.py 2009-10-06 06:57:06 UTC (rev 14501)
104 @@ -498,6 +498,10 @@
105
106 longopt_aliases = {"--cols":"--columns", "--skip-first":"--skipfirst"}
107 argument_options = {
108 + "--accept-properties": {
109 + "help":"temporarily override ACCEPT_PROPERTIES",
110 + "action":"store"
111 + },
112 "--config-root": {
113 "help":"specify the location for portage configuration files",
114 "action":"store"
115 @@ -1047,6 +1051,8 @@
116 os.environ["PORTAGE_CONFIGROOT"] = myopts["--config-root"]
117 if "--root" in myopts:
118 os.environ["ROOT"] = myopts["--root"]
119 + if "--accept-properties" in myopts:
120 + os.environ["ACCEPT_PROPERTIES"] = myopts["--accept-properties"]
121
122 # Portage needs to ensure a sane umask for the files it creates.
123 os.umask(0o22)