Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:prefix commit in: /
Date: Sat, 31 Mar 2012 19:31:54
Message-Id: 1333222259.1fac28c57317b8174580b8243c3549fd75aeaa6d.grobian@gentoo
1 commit: 1fac28c57317b8174580b8243c3549fd75aeaa6d
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 31 19:30:59 2012 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sat Mar 31 19:30:59 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=1fac28c5
7
8 Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix
9
10 Conflicts:
11 bin/ebuild-helpers/dosym
12 bin/ebuild-helpers/fowners
13 bin/etc-update
14 bin/repoman
15 pym/_emerge/main.py
16
17
18 Makefile | 215 ++++++
19 bin/dispatch-conf | 50 +-
20 bin/ebuild-helpers/dosym | 7 +-
21 bin/ebuild-helpers/fowners | 16 +-
22 bin/ebuild.sh | 46 +-
23 bin/emerge-webrsync | 12 +-
24 bin/etc-update | 756 +++++++++++---------
25 bin/isolated-functions.sh | 2 +-
26 bin/misc-functions.sh | 19 +
27 bin/portageq | 8 +
28 bin/repoman | 68 ++-
29 man/etc-update.1 | 32 +-
30 man/portage.5 | 5 +-
31 man/repoman.1 | 17 +-
32 mkrelease.sh | 2 +-
33 pym/_emerge/AsynchronousTask.py | 15 +
34 pym/_emerge/Binpkg.py | 6 +-
35 pym/_emerge/BlockerCache.py | 2 +-
36 pym/_emerge/CompositeTask.py | 2 +-
37 pym/_emerge/EbuildBuild.py | 11 +-
38 pym/_emerge/EbuildFetcher.py | 14 +-
39 pym/_emerge/JobStatusDisplay.py | 2 +-
40 pym/_emerge/Package.py | 4 +-
41 pym/_emerge/PollScheduler.py | 2 +-
42 pym/_emerge/QueueScheduler.py | 2 +-
43 pym/_emerge/Scheduler.py | 12 +-
44 pym/_emerge/_flush_elog_mod_echo.py | 2 +-
45 pym/_emerge/actions.py | 103 ++-
46 pym/_emerge/depgraph.py | 12 +-
47 pym/_emerge/main.py | 9 +-
48 pym/_emerge/resolver/output.py | 30 +-
49 pym/_emerge/resolver/output_helpers.py | 78 ++-
50 pym/_emerge/unmerge.py | 14 +-
51 pym/_emerge/userquery.py | 6 +-
52 pym/portage/cache/mappings.py | 2 +-
53 pym/portage/dbapi/_MergeProcess.py | 13 +-
54 pym/portage/dbapi/bintree.py | 6 +-
55 pym/portage/dbapi/porttree.py | 6 +-
56 pym/portage/dbapi/vartree.py | 60 ++-
57 pym/portage/dep/__init__.py | 2 +-
58 pym/portage/dispatch_conf.py | 28 +-
59 pym/portage/env/loaders.py | 4 +-
60 pym/portage/glsa.py | 8 +-
61 pym/portage/locks.py | 22 +-
62 pym/portage/manifest.py | 10 +-
63 pym/portage/news.py | 2 +-
64 pym/portage/output.py | 6 +
65 pym/portage/package/ebuild/_ipc/QueryCommand.py | 2 +-
66 pym/portage/package/ebuild/_spawn_nofetch.py | 6 +-
67 pym/portage/package/ebuild/digestcheck.py | 2 +-
68 pym/portage/package/ebuild/digestgen.py | 5 +-
69 pym/portage/package/ebuild/doebuild.py | 63 +-
70 pym/portage/package/ebuild/getmaskingreason.py | 8 +-
71 pym/portage/process.py | 18 +-
72 pym/portage/tests/locks/test_lock_nonblock.py | 5 +-
73 pym/portage/util/ExtractKernelVersion.py | 2 +-
74 pym/portage/util/__init__.py | 20 +-
75 .../util/_dyn_libs/PreservedLibsRegistry.py | 50 +-
76 pym/portage/util/_eventloop/EventLoop.py | 2 +-
77 pym/portage/util/_pty.py | 2 +-
78 pym/portage/util/lafilefixer.py | 2 +-
79 pym/portage/util/listdir.py | 2 +-
80 pym/portage/util/movefile.py | 61 +-
81 pym/portage/util/mtimedb.py | 24 +-
82 pym/portage/util/whirlpool.py | 2 +-
83 pym/portage/xpak.py | 247 ++++----
84 pym/repoman/utilities.py | 39 +-
85 67 files changed, 1513 insertions(+), 799 deletions(-)
86
87 diff --cc bin/dispatch-conf
88 index 1b86461,139a001..de8d85d
89 --- a/bin/dispatch-conf
90 +++ b/bin/dispatch-conf
91 @@@ -33,9 -27,8 +33,9 @@@ import portag
92 from portage import os
93 from portage import dispatch_conf
94 from portage import _unicode_decode
95 - from portage.dispatch_conf import diffstatusoutput_len
96 + from portage.dispatch_conf import diffstatusoutput
97 from portage.process import find_binary
98 +from portage.const import EPREFIX
99
100 FIND_EXTANT_CONFIGS = "find '%s' %s -name '._cfg????_%s' ! -name '.*~' ! -iname '.*.bak' -print"
101 DIFF_CONTENTS = "diff -Nu '%s' '%s'"
102 diff --cc bin/ebuild-helpers/dosym
103 index 8f436fa,2489e22..b96f845
104 --- a/bin/ebuild-helpers/dosym
105 +++ b/bin/ebuild-helpers/dosym
106 @@@ -1,8 -1,8 +1,8 @@@
107 -#!/bin/bash
108 +#!@PORTAGE_BASH@
109 - # Copyright 1999-2011 Gentoo Foundation
110 + # Copyright 1999-2012 Gentoo Foundation
111 # Distributed under the terms of the GNU General Public License v2
112
113 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
114 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
115
116 if [[ $# -ne 2 ]] ; then
117 helpers_die "${0##*/}: two arguments needed"
118 diff --cc bin/ebuild-helpers/fowners
119 index 9815d2e,a213c9e..b60aad7
120 --- a/bin/ebuild-helpers/fowners
121 +++ b/bin/ebuild-helpers/fowners
122 @@@ -1,18 -1,11 +1,12 @@@
123 -#!/bin/bash
124 +#!@PORTAGE_BASH@
125 - # Copyright 1999-2011 Gentoo Foundation
126 + # Copyright 1999-2012 Gentoo Foundation
127 # Distributed under the terms of the GNU General Public License v2
128
129 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
130 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
131 +
132 - # PREFIX LOCAL: ignore otherwise failing call
133 - if hasq prefix ${USE} && [[ $EUID != 0 ]] ; then
134 - ewarn "fowners ignored in Prefix with non-privileged user"
135 - exit 0
136 - fi
137 - # END PREFIX LOCAL
138
139 [[ " ${FEATURES} " == *" force-prefix "* ]] || \
140 - case "$EAPI" in 0|1|2) ED=${D} ;; esac
141 + case "$EAPI" in 0|1|2) EPREFIX= ED=${D} ;; esac
142
143 # we can't prefix all arguments because
144 # chown takes random options
145 diff --cc bin/emerge-webrsync
146 index c41eb79,bfd9aa2..581dc54
147 --- a/bin/emerge-webrsync
148 +++ b/bin/emerge-webrsync
149 @@@ -31,11 -39,10 +39,11 @@@ els
150 eecho "could not find 'portageq'; aborting"
151 exit 1
152 fi
153 - eval $(portageq envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \
154 + eval $("${portageq}" envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \
155 PORTAGE_BIN_PATH PORTAGE_GPG_DIR \
156 PORTAGE_NICENESS PORTAGE_RSYNC_EXTRA_OPTS PORTAGE_TMPDIR PORTDIR \
157 - SYNC http_proxy ftp_proxy)
158 + SYNC http_proxy ftp_proxy \
159 + EPREFIX PORTAGE_USER PORTAGE_GROUP)
160 DISTDIR="${PORTAGE_TMPDIR}/emerge-webrsync"
161 export http_proxy ftp_proxy
162
163 diff --cc bin/etc-update
164 index b3877fb,1edc91f..2a24613
165 --- a/bin/etc-update
166 +++ b/bin/etc-update
167 @@@ -1,5 -1,5 +1,5 @@@
168 -#!/bin/bash
169 +#!@PORTAGE_BASH@
170 - # Copyright 1999-2011 Gentoo Foundation
171 + # Copyright 1999-2012 Gentoo Foundation
172 # Distributed under the terms of the GNU General Public License v2
173
174 # Author Brandon Low <lostlogic@g.o>
175 diff --cc bin/misc-functions.sh
176 index 406cd8f,b083897..0d60a51
177 mode 100644,100755..100644
178 --- a/bin/misc-functions.sh
179 +++ b/bin/misc-functions.sh
180 diff --cc bin/repoman
181 index 1f51ddf,54d864f..b89e5ef
182 --- a/bin/repoman
183 +++ b/bin/repoman
184 @@@ -1,5 -1,5 +1,5 @@@
185 -#!/usr/bin/python -O
186 +#!@PREFIX_PORTAGE_PYTHON@ -O
187 - # Copyright 1999-2011 Gentoo Foundation
188 + # Copyright 1999-2012 Gentoo Foundation
189 # Distributed under the terms of the GNU General Public License v2
190
191 # Next to do: dep syntax checking in mask files
192 diff --cc pym/_emerge/actions.py
193 index 15a0bc1,22c3e26..cbc5de2
194 --- a/pym/_emerge/actions.py
195 +++ b/pym/_emerge/actions.py
196 @@@ -25,12 -25,12 +25,12 @@@ portage.proxy.lazyimport.lazyimport(glo
197 'portage.news:count_unread_news,display_news_notifications',
198 )
199
200 + from portage.localization import _
201 from portage import os
202 from portage import shutil
203 - from portage import subprocess_getstatusoutput
204 from portage import _unicode_decode
205 from portage.cache.cache_errors import CacheError
206 -from portage.const import GLOBAL_CONFIG_PATH
207 +from portage.const import GLOBAL_CONFIG_PATH, EPREFIX
208 from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
209 from portage.dbapi.dep_expand import dep_expand
210 from portage.dbapi._expand_new_virt import expand_new_virt
211 diff --cc pym/_emerge/main.py
212 index 3d50b7d,0fbc4b7..68e951d
213 --- a/pym/_emerge/main.py
214 +++ b/pym/_emerge/main.py
215 @@@ -180,11 -180,21 +181,11 @@@ def chk_updated_info_files(root, infodi
216 raise
217 del e
218 processed_count += 1
219 - try:
220 - proc = subprocess.Popen(
221 - ['/usr/bin/install-info',
222 - '--dir-file=%s' % os.path.join(inforoot, "dir"),
223 - os.path.join(inforoot, x)],
224 - env=dict(os.environ, LANG="C", LANGUAGE="C"),
225 - stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
226 - except OSError:
227 - myso = None
228 - else:
229 - myso = _unicode_decode(
230 - proc.communicate()[0]).rstrip("\n")
231 - proc.wait()
232 + myso = portage.subprocess_getstatusoutput(
233 + "LANG=C LANGUAGE=C %s/usr/bin/install-info " \
234 + "--dir-file=%s/dir %s/%s" % (EPREFIX, inforoot, inforoot, x))[1]
235 existsstr="already exists, for file `"
236 - if myso!="":
237 + if myso:
238 if re.search(existsstr,myso):
239 # Already exists... Don't increment the count for this.
240 pass
241 diff --cc pym/portage/dispatch_conf.py
242 index 88ed222,cc98fad..2fa1357
243 --- a/pym/portage/dispatch_conf.py
244 +++ b/pym/portage/dispatch_conf.py
245 @@@ -24,23 -23,23 +24,23 @@@ RCS_MERGE = "rcsmerge -p -r" + RCS_BRAN
246
247 DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'"
248
249 - def diffstatusoutput_len(cmd):
250 + def diffstatusoutput(cmd, file1, file2):
251 """
252 Execute the string cmd in a shell with getstatusoutput() and return a
253 - 2-tuple (status, output_length). If getstatusoutput() raises
254 - UnicodeDecodeError (known to happen with python3.1), return a
255 - 2-tuple (1, 1). This provides a simple way to check for non-zero
256 - output length of diff commands, while providing simple handling of
257 - UnicodeDecodeError when necessary.
258 + 2-tuple (status, output).
259 """
260 - try:
261 - status, output = portage.subprocess_getstatusoutput(cmd)
262 - return (status, len(output))
263 - except UnicodeDecodeError:
264 - return (1, 1)
265 + # Use Popen to emulate getstatusoutput(), since getstatusoutput() may
266 + # raise a UnicodeDecodeError which makes the output inaccessible.
267 + proc = subprocess.Popen(portage._unicode_encode(cmd % (file1, file2)),
268 + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)
269 + output = portage._unicode_decode(proc.communicate()[0])
270 + if output and output[-1] == "\n":
271 + # getstatusoutput strips one newline
272 + output = output[:-1]
273 + return (proc.wait(), output)
274
275 def read_config(mandatory_opts):
276 - eprefix = portage.const.EPREFIX
277 + eprefix = EPREFIX
278 config_path = os.path.join(eprefix or os.sep, "etc/dispatch-conf.conf")
279 loader = KeyValuePairFileLoader(config_path, None)
280 opts, errors = loader.load()