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: Fri, 06 Jul 2012 07:06:07
Message-Id: 1341558143.f028e1bfb2b97990b558b0c1a8782838aeae175c.grobian@gentoo
1 commit: f028e1bfb2b97990b558b0c1a8782838aeae175c
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 6 07:02:23 2012 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 6 07:02:23 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f028e1bf
7
8 Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix
9
10 Conflicts:
11 bin/dohtml.py
12 bin/ebuild
13 bin/ebuild-helpers/ecompressdir
14 bin/ebuild-helpers/prepstrip
15 bin/ebuild-ipc.py
16 bin/egencache
17 bin/emaint
18 bin/emerge
19 bin/misc-functions.sh
20 bin/quickpkg
21 pym/_emerge/actions.py
22 pym/portage/dbapi/vartree.py
23 pym/portage/dispatch_conf.py
24
25
26 NEWS | 9 +
27 RELEASE-NOTES | 12 +
28 bin/dohtml.py | 49 +-
29 bin/ebuild | 19 +-
30 bin/ebuild-helpers/ecompressdir | 50 +-
31 bin/ebuild-helpers/prepstrip | 115 ++-
32 bin/ebuild-ipc.py | 11 +-
33 bin/ebuild.sh | 35 +-
34 bin/egencache | 18 +-
35 bin/emaint | 9 +-
36 bin/emerge | 11 +-
37 bin/helper-functions.sh | 90 ++
38 bin/isolated-functions.sh | 8 +-
39 bin/misc-functions.sh | 78 +-
40 bin/quickpkg | 15 +-
41 bin/repoman | 81 +-
42 bin/save-ebuild-env.sh | 6 +-
43 cnf/make.globals | 13 +-
44 doc/package/ebuild.docbook | 1 +
45 doc/package/ebuild/eapi/4-python.docbook | 218 ++--
46 doc/package/ebuild/eapi/4-slot-abi.docbook | 70 ++
47 doc/portage.docbook | 1 +
48 man/ebuild.5 | 6 +-
49 man/emerge.1 | 39 +-
50 man/make.conf.5 | 62 +-
51 man/portage.5 | 26 +-
52 man/repoman.1 | 20 +-
53 pym/_emerge/AtomArg.py | 5 +-
54 pym/_emerge/BlockerCache.py | 9 +-
55 pym/_emerge/Dependency.py | 2 +-
56 pym/_emerge/DependencyArg.py | 14 +-
57 pym/_emerge/EbuildMetadataPhase.py | 105 ++-
58 pym/_emerge/EbuildPhase.py | 17 +-
59 pym/_emerge/FakeVartree.py | 34 +-
60 pym/_emerge/MetadataRegen.py | 8 +-
61 pym/_emerge/Package.py | 129 ++-
62 pym/_emerge/PollScheduler.py | 27 +-
63 pym/_emerge/QueueScheduler.py | 4 +-
64 pym/_emerge/Scheduler.py | 7 +-
65 pym/_emerge/SetArg.py | 5 +-
66 pym/_emerge/TaskScheduler.py | 6 +-
67 pym/_emerge/actions.py | 74 +-
68 pym/_emerge/create_depgraph_params.py | 14 +
69 pym/_emerge/depgraph.py | 1236 +++++++++++++-------
70 pym/_emerge/main.py | 38 +-
71 pym/_emerge/resolver/backtracking.py | 36 +-
72 pym/_emerge/resolver/output.py | 25 +-
73 pym/_emerge/resolver/slot_collision.py | 44 +-
74 pym/_emerge/unmerge.py | 22 +-
75 pym/portage/__init__.py | 39 +-
76 pym/portage/_sets/__init__.py | 12 +-
77 pym/portage/_sets/dbapi.py | 14 +-
78 pym/portage/_sets/files.py | 13 +-
79 pym/portage/_sets/security.py | 8 +-
80 pym/portage/cache/fs_template.py | 22 +-
81 pym/portage/cache/sqlite.py | 42 +-
82 pym/portage/cache/template.py | 14 +-
83 pym/portage/const.py | 30 +-
84 pym/portage/dbapi/__init__.py | 92 +-
85 pym/portage/dbapi/bintree.py | 41 +-
86 pym/portage/dbapi/porttree.py | 120 +--
87 pym/portage/dbapi/vartree.py | 219 +++-
88 pym/portage/dbapi/virtual.py | 55 +-
89 pym/portage/dep/__init__.py | 571 ++++++---
90 pym/portage/dep/_slot_abi.py | 92 ++
91 pym/portage/dep/dep_check.py | 51 +-
92 pym/portage/dispatch_conf.py | 10 +-
93 pym/portage/eapi.py | 44 +
94 pym/portage/getbinpkg.py | 19 +-
95 pym/portage/glsa.py | 15 +-
96 .../package/ebuild/_config/KeywordsManager.py | 21 +-
97 .../package/ebuild/_config/LicenseManager.py | 9 +-
98 .../package/ebuild/_config/LocationsManager.py | 71 +-
99 pym/portage/package/ebuild/_config/UseManager.py | 12 +-
100 pym/portage/package/ebuild/_config/helper.py | 4 +-
101 .../package/ebuild/_config/special_env_vars.py | 13 +-
102 pym/portage/package/ebuild/_eapi_invalid.py | 54 +
103 pym/portage/package/ebuild/_ipc/QueryCommand.py | 10 +-
104 pym/portage/package/ebuild/config.py | 143 ++-
105 pym/portage/package/ebuild/doebuild.py | 180 ++--
106 pym/portage/package/ebuild/fetch.py | 7 +-
107 pym/portage/package/ebuild/getmaskingstatus.py | 16 +-
108 pym/portage/repository/config.py | 32 +-
109 pym/portage/tests/dbapi/test_fakedbapi.py | 7 +-
110 pym/portage/tests/dep/testAtom.py | 19 +
111 pym/portage/tests/dep/testStandalone.py | 5 +-
112 pym/portage/tests/dep/test_isvalidatom.py | 9 +
113 pym/portage/tests/dep/test_match_from_list.py | 31 +-
114 pym/portage/tests/ebuild/test_config.py | 4 +-
115 pym/portage/tests/emerge/test_emerge_slot_abi.py | 201 ++++
116 pym/portage/tests/emerge/test_simple.py | 6 +-
117 pym/portage/tests/repoman/test_echangelog.py | 110 ++
118 pym/portage/tests/resolver/ResolverPlayground.py | 57 +-
119 pym/portage/tests/resolver/test_autounmask.py | 17 +-
120 pym/portage/tests/resolver/test_complete_graph.py | 4 +-
121 pym/portage/tests/resolver/test_merge_order.py | 6 +-
122 pym/portage/tests/resolver/test_simple.py | 23 +-
123 pym/portage/tests/resolver/test_slot_abi.py | 376 ++++++
124 .../tests/resolver/test_slot_abi_downgrade.py | 225 ++++
125 pym/portage/tests/resolver/test_slot_collisions.py | 12 +
126 pym/portage/tests/runTests | 11 +-
127 pym/portage/tests/util/test_digraph.py | 50 +-
128 pym/portage/tests/util/test_stackLists.py | 4 +-
129 pym/portage/util/__init__.py | 64 +-
130 pym/portage/util/_desktop_entry.py | 75 ++
131 pym/portage/util/_eventloop/EventLoop.py | 50 +-
132 pym/portage/util/_urlopen.py | 42 +
133 pym/portage/util/digraph.py | 15 +-
134 pym/portage/util/movefile.py | 6 +-
135 pym/portage/versions.py | 215 +++-
136 pym/portage/xml/metadata.py | 10 +-
137 pym/portage/xpak.py | 10 +-
138 pym/repoman/checks.py | 320 ++++--
139 pym/repoman/errors.py | 1 -
140 pym/repoman/herdbase.py | 6 +-
141 pym/repoman/utilities.py | 68 +-
142 runtests.sh | 2 +-
143 117 files changed, 5210 insertions(+), 1879 deletions(-)
144
145 diff --cc bin/dohtml.py
146 index 18095bd,3e80ef5..59d388b
147 --- a/bin/dohtml.py
148 +++ b/bin/dohtml.py
149 @@@ -1,5 -1,5 +1,5 @@@
150 -#!/usr/bin/python
151 +#!@PREFIX_PORTAGE_PYTHON@
152 - # Copyright 1999-2006 Gentoo Foundation
153 + # Copyright 1999-2012 Gentoo Foundation
154 # Distributed under the terms of the GNU General Public License v2
155
156 #
157 diff --cc bin/ebuild
158 index 599cc6c,65e5bef..04cb4c6
159 --- a/bin/ebuild
160 +++ b/bin/ebuild
161 @@@ -1,5 -1,5 +1,5 @@@
162 -#!/usr/bin/python -O
163 +#!@PREFIX_PORTAGE_PYTHON@ -O
164 - # Copyright 1999-2011 Gentoo Foundation
165 + # Copyright 1999-2012 Gentoo Foundation
166 # Distributed under the terms of the GNU General Public License v2
167
168 from __future__ import print_function
169 diff --cc bin/ebuild-helpers/ecompressdir
170 index 58c410e,6801a07..bf76b1f
171 --- a/bin/ebuild-helpers/ecompressdir
172 +++ b/bin/ebuild-helpers/ecompressdir
173 @@@ -2,7 -2,7 +2,7 @@@
174 # Copyright 1999-2011 Gentoo Foundation
175 # Distributed under the terms of the GNU General Public License v2
176
177 - source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
178 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
179 ++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh
180
181 if [[ -z $1 ]] ; then
182 helpers_die "${0##*/}: at least one argument needed"
183 diff --cc bin/ebuild-helpers/prepstrip
184 index 0042abe,85d5d6a..22cb72e
185 --- a/bin/ebuild-helpers/prepstrip
186 +++ b/bin/ebuild-helpers/prepstrip
187 @@@ -1,8 -1,8 +1,8 @@@
188 -#!/bin/bash
189 +#!@PORTAGE_BASH@
190 - # Copyright 1999-2011 Gentoo Foundation
191 + # Copyright 1999-2012 Gentoo Foundation
192 # Distributed under the terms of the GNU General Public License v2
193
194 - source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
195 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
196 ++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh
197
198 # avoid multiple calls to `has`. this creates things like:
199 # FEATURES_foo=false
200 diff --cc bin/ebuild-ipc.py
201 index f95bac8,3caf2d1..7533c8c
202 --- a/bin/ebuild-ipc.py
203 +++ b/bin/ebuild-ipc.py
204 @@@ -1,5 -1,5 +1,5 @@@
205 -#!/usr/bin/python
206 +#!@PREFIX_PORTAGE_PYTHON@
207 - # Copyright 2010-2011 Gentoo Foundation
208 + # Copyright 2010-2012 Gentoo Foundation
209 # Distributed under the terms of the GNU General Public License v2
210 #
211 # This is a helper which ebuild processes can use
212 diff --cc bin/egencache
213 index 01f8e1d,a75a341..5edb180
214 --- a/bin/egencache
215 +++ b/bin/egencache
216 @@@ -1,5 -1,5 +1,5 @@@
217 -#!/usr/bin/python
218 +#!@PREFIX_PORTAGE_PYTHON@
219 - # Copyright 2009-2011 Gentoo Foundation
220 + # Copyright 2009-2012 Gentoo Foundation
221 # Distributed under the terms of the GNU General Public License v2
222
223 from __future__ import print_function
224 @@@ -42,8 -42,7 +42,8 @@@ from portage.manifest import guessManif
225 from portage.util import cmp_sort_key, writemsg_level
226 from portage import cpv_getkey
227 from portage.dep import Atom, isjustname
228 - from portage.versions import pkgcmp, pkgsplit, vercmp
229 + from portage.versions import pkgsplit, vercmp
230 +from portage.const import EPREFIX
231
232 try:
233 from xml.etree import ElementTree
234 diff --cc bin/emaint
235 index 91d68d5,cf2ccb8..4d8b4f3
236 --- a/bin/emaint
237 +++ b/bin/emaint
238 @@@ -1,5 -1,6 +1,6 @@@
239 -#!/usr/bin/python -O
240 +#!@PREFIX_PORTAGE_PYTHON@ -O
241 - # vim: noet :
242 + # Copyright 2005-2012 Gentoo Foundation
243 + # Distributed under the terms of the GNU General Public License v2
244
245 from __future__ import print_function
246
247 diff --cc bin/emerge
248 index 324f673,a9a5643..85154fb
249 --- a/bin/emerge
250 +++ b/bin/emerge
251 @@@ -1,5 -1,5 +1,5 @@@
252 -#!/usr/bin/python
253 +#!@PREFIX_PORTAGE_PYTHON@
254 - # Copyright 2006-2011 Gentoo Foundation
255 + # Copyright 2006-2012 Gentoo Foundation
256 # Distributed under the terms of the GNU General Public License v2
257
258 from __future__ import print_function
259 @@@ -26,16 -27,21 +27,22 @@@ except KeyboardInterrupt
260 def debug_signal(signum, frame):
261 import pdb
262 pdb.set_trace()
263 - signal.signal(signal.SIGUSR1, debug_signal)
264 +
265 + if platform.python_implementation() == 'Jython':
266 + debug_signum = signal.SIGUSR2 # bug #424259
267 + else:
268 + debug_signum = signal.SIGUSR1
269 +
270 + signal.signal(debug_signum, debug_signal)
271
272 -try:
273 - from _emerge.main import emerge_main
274 -except ImportError:
275 - from os import path as osp
276 - import sys
277 - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
278 - from _emerge.main import emerge_main
279 +# for an explanation on this logic, see pym/_emerge/__init__.py
280 +from os import environ as ose
281 +from os import path as osp
282 +if ose.__contains__("PORTAGE_PYTHONPATH"):
283 + sys.path.insert(0, ose["PORTAGE_PYTHONPATH"])
284 +else:
285 + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp. realpath(__file__))), "pym"))
286 +from _emerge.main import emerge_main
287
288 if __name__ == "__main__":
289 import sys
290 diff --cc bin/misc-functions.sh
291 index a7a18e2,9eec8bb..496c2d7
292 mode 100644,100755..100644
293 --- a/bin/misc-functions.sh
294 +++ b/bin/misc-functions.sh
295 @@@ -153,11 -150,9 +153,11 @@@ prepcompress()
296 install_qa_check() {
297 local f i qa_var x
298 [[ " ${FEATURES} " == *" force-prefix "* ]] || \
299 - case "$EAPI" in 0|1|2) local ED=${D} ;; esac
300 + case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac
301
302 - cd "${ED}" || die "cd failed"
303 + # PREFIX LOCAL: ED needs not to exist, whereas D does
304 + cd "${D}" || die "cd failed"
305 + # END PREFIX LOCAL
306
307 # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since
308 # QA_DT_HASH is deprecated.
309 @@@ -276,7 -271,7 +276,9 @@@
310 fi
311
312 # Now we look for all world writable files.
313 -- local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${ED}:- :")
314 ++ # PREFIX LOCAL: keep offset in the paths
315 ++ local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${D}:- :")
316 ++ # END PREFIX LOCAL
317 if [[ -n ${unsafe_files} ]] ; then
318 vecho "QA Security Notice: world writable file(s):"
319 vecho "${unsafe_files}"
320 @@@ -586,12 -509,36 +551,40 @@@ install_qa_check_elf()
321
322 PORTAGE_QUIET=${tmp_quiet}
323 fi
324 +
325 + # Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is
326 + # too useful not to have (it's required for things like preserve-libs), and
327 + # it's tempting for ebuild authors to set RESTRICT=binchecks for packages
328 + # containing pre-built binaries.
329 + if type -P scanelf > /dev/null ; then
330 + # Save NEEDED information after removing self-contained providers
331 + rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2}
332 + scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read -r l; do
333 + arch=${l%%;*}; l=${l#*;}
334 + obj="/${l%%;*}"; l=${l#*;}
335 + soname=${l%%;*}; l=${l#*;}
336 + rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = " - " ] && rpath=""
337 + needed=${l%%;*}; l=${l#*;}
338 + echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
339 + echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2
340 + done }
341 +
342 + [ -n "${QA_SONAME_NO_SYMLINK}" ] && \
343 + echo "${QA_SONAME_NO_SYMLINK}" > \
344 + "${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK
345 +
346 + if has binchecks ${RESTRICT} && \
347 + [ -s "${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2" ] ; then
348 + eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:"
349 + eqawarn "$(while read -r x; do x=${x#*;} ; x=${x%%;*} ; echo "${x#${EPREFIX}}" ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
350 + fi
351 + fi
352 +}
353
354 - local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ED}:/:")
355 +install_qa_check_misc() {
356 + # PREFIX LOCAL: keep offset prefix in the reported files
357 + local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${D}:/:")
358 + # END PREFIX LOCAL
359 if [[ -n ${unsafe_files} ]] ; then
360 eqawarn "QA Notice: Unsafe files detected (set*id and world writable)"
361 eqawarn "${unsafe_files}"
362 diff --cc bin/quickpkg
363 index fb7f874,a6bd4d4..83c0d7b
364 --- a/bin/quickpkg
365 +++ b/bin/quickpkg
366 @@@ -1,5 -1,5 +1,5 @@@
367 -#!/usr/bin/python
368 +#!@PREFIX_PORTAGE_PYTHON@
369 - # Copyright 1999-2010 Gentoo Foundation
370 + # Copyright 1999-2012 Gentoo Foundation
371 # Distributed under the terms of the GNU General Public License v2
372
373 from __future__ import print_function
374 diff --cc cnf/make.globals
375 index 2e2171d,db97d8b..7e61325
376 --- a/cnf/make.globals
377 +++ b/cnf/make.globals
378 @@@ -141,12 -123,12 +146,12 @@@ PORTAGE_WORKDIR_MODE="0700
379 PORTAGE_ELOG_CLASSES="log warn error"
380 PORTAGE_ELOG_SYSTEM="save_summary echo"
381
382 -PORTAGE_ELOG_MAILURI="root"
383 +PORTAGE_ELOG_MAILURI="@rootuser@"
384 PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
385 -PORTAGE_ELOG_MAILFROM="portage@localhost"
386 +PORTAGE_ELOG_MAILFROM="@portageuser@@localhost"
387
388 # Signing command used by repoman
389 - PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --clearsign --yes --default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" \"\${FILE}\""
390 + PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --digest-algo SHA512 --clearsign --yes --default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" \"\${FILE}\""
391
392 # *****************************
393 # ** DO NOT EDIT THIS FILE **
394 diff --cc pym/_emerge/Package.py
395 index f818951,14d0694..228cd96
396 --- a/pym/_emerge/Package.py
397 +++ b/pym/_emerge/Package.py
398 @@@ -8,12 -8,11 +8,12 @@@ from portage import _encodings, _unicod
399 from portage.cache.mappings import slot_dict_class
400 from portage.const import EBUILD_PHASES
401 from portage.dep import Atom, check_required_use, use_reduce, \
402 - paren_enclose, _slot_re, _slot_separator, _repo_separator
403 - from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use
404 + paren_enclose, _slot_separator, _repo_separator
405 + from portage.versions import _pkg_str, _unknown_repo
406 + from portage.eapi import _get_eapi_attrs
407 from portage.exception import InvalidDependString
408 - from portage.repository.config import _gen_valid_repo
409 from _emerge.Task import Task
410 +from portage.const import EPREFIX
411
412 if sys.hexversion >= 0x3000000:
413 basestring = str
414 diff --cc pym/_emerge/actions.py
415 index eb74085,af42828..2135f09
416 --- a/pym/_emerge/actions.py
417 +++ b/pym/_emerge/actions.py
418 @@@ -28,10 -28,10 +28,11 @@@ portage.proxy.lazyimport.lazyimport(glo
419 from portage.localization import _
420 from portage import os
421 from portage import shutil
422 - from portage import _unicode_decode
423 + from portage import eapi_is_supported, _unicode_decode
424 from portage.cache.cache_errors import CacheError
425 - from portage.const import GLOBAL_CONFIG_PATH, EPREFIX
426 - from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG
427 ++from portage.const import EPREFIX
428 + from portage.const import GLOBAL_CONFIG_PATH
429 + from portage.const import _ENABLE_DYN_LINK_MAP
430 from portage.dbapi.dep_expand import dep_expand
431 from portage.dbapi._expand_new_virt import expand_new_virt
432 from portage.dep import Atom, extended_cp_match
433 diff --cc pym/portage/_sets/files.py
434 index 7992b82,b891ea4..69bdc0d
435 --- a/pym/portage/_sets/files.py
436 +++ b/pym/portage/_sets/files.py
437 @@@ -1,6 -1,7 +1,6 @@@
438 - # Copyright 2007-2011 Gentoo Foundation
439 + # Copyright 2007-2012 Gentoo Foundation
440 # Distributed under the terms of the GNU General Public License v2
441
442 -import errno
443 import re
444 from itertools import chain
445
446 diff --cc pym/portage/const.py
447 index cd8ecfb,ceef5c5..267798c
448 --- a/pym/portage/const.py
449 +++ b/pym/portage/const.py
450 @@@ -1,12 -1,7 +1,12 @@@
451 # portage: Constants
452 - # Copyright 1998-2011 Gentoo Foundation
453 + # Copyright 1998-2012 Gentoo Foundation
454 # Distributed under the terms of the GNU General Public License v2
455
456 +# ===========================================================================
457 +# autotool supplied constants.
458 +# ===========================================================================
459 +from portage.const_autotool import *
460 +
461 import os
462
463 # ===========================================================================
464 @@@ -125,10 -90,10 +125,11 @@@ SUPPORTED_FEATURES = frozenset(
465 "ccache", "chflags", "clean-logs",
466 "collision-protect", "compress-build-logs", "compressdebug",
467 "config-protect-if-modified",
468 - "digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot",
469 + "digest", "distcc", "distcc-pump", "distlocks",
470 + "downgrade-backup", "ebuild-locks", "fakeroot",
471 "fail-clean", "force-mirror", "force-prefix", "getbinpkg",
472 "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
473 + "macossandbox", "macosprefixsandbox", "macosusersandbox",
474 "metadata-transfer", "mirror", "multilib-strict", "news",
475 "noauto", "noclean", "nodoc", "noinfo", "noman",
476 "nostrip", "notitles", "parallel-fetch", "parallel-install",
477 diff --cc pym/portage/dbapi/bintree.py
478 index 77ab4df,1048cc1..170ed18
479 --- a/pym/portage/dbapi/bintree.py
480 +++ b/pym/portage/dbapi/bintree.py
481 @@@ -23,9 -23,8 +23,9 @@@ from portage.cache.mappings import slot
482 from portage.const import CACHE_PATH
483 from portage.dbapi.virtual import fakedbapi
484 from portage.dep import Atom, use_reduce, paren_enclose
485 - from portage.exception import AlarmSignal, InvalidPackageName, \
486 + from portage.exception import AlarmSignal, InvalidData, InvalidPackageName, \
487 PermissionDenied, PortageException
488 +from portage.const import EAPI
489 from portage.localization import _
490 from portage import _movefile
491 from portage import os
492 diff --cc pym/portage/dbapi/vartree.py
493 index 340de4c,fbf2e74..109545a
494 --- a/pym/portage/dbapi/vartree.py
495 +++ b/pym/portage/dbapi/vartree.py
496 @@@ -30,11 -32,8 +32,11 @@@ portage.proxy.lazyimport.lazyimport(glo
497 'portage.util.movefile:movefile',
498 'portage.util._dyn_libs.PreservedLibsRegistry:PreservedLibsRegistry',
499 'portage.util._dyn_libs.LinkageMapELF:LinkageMapELF@LinkageMap',
500 + 'portage.util._dyn_libs.LinkageMapMachO:LinkageMapMachO',
501 + 'portage.util._dyn_libs.LinkageMapPeCoff:LinkageMapPeCoff',
502 + 'portage.util._dyn_libs.LinkageMapXCoff:LinkageMapXCoff',
503 - 'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,pkgcmp,' + \
504 - '_pkgsplit@pkgsplit',
505 + 'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,vercmp,' + \
506 + '_pkgsplit@pkgsplit,_pkg_str',
507 'subprocess',
508 'tarfile',
509 )
510 @@@ -89,8 -90,10 +93,11 @@@ except ImportError
511 if sys.hexversion >= 0x3000000:
512 basestring = str
513 long = int
514 + _unicode = str
515 + else:
516 + _unicode = unicode
517
518 +
519 class vardbapi(dbapi):
520
521 _excluded_dirs = ["CVS", "lost+found"]
522 diff --cc pym/portage/dispatch_conf.py
523 index 2ab7301,4c68dfc..7729195
524 --- a/pym/portage/dispatch_conf.py
525 +++ b/pym/portage/dispatch_conf.py
526 @@@ -13,8 -13,7 +13,8 @@@ import os, shutil, subprocess, sy
527 import portage
528 from portage.env.loaders import KeyValuePairFileLoader
529 from portage.localization import _
530 - from portage.util import varexpand
531 + from portage.util import shlex_split, varexpand
532 +from portage.const import EPREFIX
533
534 RCS_BRANCH = '1.1.1'
535 RCS_LOCK = 'rcs -ko -M -l'
536 diff --cc pym/portage/package/ebuild/doebuild.py
537 index f35777a,09062f9..2322746
538 --- a/pym/portage/package/ebuild/doebuild.py
539 +++ b/pym/portage/package/ebuild/doebuild.py
540 @@@ -32,11 -33,10 +34,11 @@@ portage.proxy.lazyimport.lazyimport(glo
541
542 from portage import auxdbkeys, bsd_chflags, \
543 eapi_is_supported, merge, os, selinux, shutil, \
544 - unmerge, _encodings, _parse_eapi_ebuild_head, _os_merge, \
545 + unmerge, _encodings, _os_merge, \
546 _shell_quote, _unicode_decode, _unicode_encode
547 from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_ENV_DIR, \
548 - EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY
549 + EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY, \
550 + EPREFIX, MACOSSANDBOX_PROFILE
551 from portage.data import portage_gid, portage_uid, secpass, \
552 uid, userpriv_groups
553 from portage.dbapi.porttree import _parse_uri_map
554 diff --cc pym/portage/tests/runTests
555 index 223a8cc,91984a3..afb967c
556 --- a/pym/portage/tests/runTests
557 +++ b/pym/portage/tests/runTests
558 @@@ -1,6 -1,6 +1,6 @@@
559 -#!/usr/bin/python -Wd
560 +#!/usr/bin/env python
561 # runTests.py -- Portage Unit Test Functionality
562 - # Copyright 2006 Gentoo Foundation
563 + # Copyright 2006-2012 Gentoo Foundation
564 # Distributed under the terms of the GNU General Public License v2
565
566 import os, sys
567 diff --cc pym/portage/versions.py
568 index f0619be,5893096..81f7559
569 --- a/pym/portage/versions.py
570 +++ b/pym/portage/versions.py
571 @@@ -26,16 -39,27 +39,28 @@@ _cat = r'[\w+][\w+.-]*
572 # 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-].
573 # It must not begin with a hyphen,
574 # and must not end in a hyphen followed by one or more digits.
575 - _pkg = r'[\w+][\w+-]*?'
576 + _pkg = {
577 + "dots_disallowed_in_PN": r'[\w+][\w+-]*?',
578 + "dots_allowed_in_PN": r'[\w+][\w+.-]*?',
579 + }
580
581 _v = r'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)'
582 -_rev = r'\d+'
583 +# PREFIX hack: -r(\d+) -> -r(\d+|0\d+\.\d+) (see below)
584 +_rev = r'(\d+|0\d+\.\d+)'
585 _vr = _v + '(-r(' + _rev + '))?'
586
587 - _cp = '(' + _cat + '/' + _pkg + '(-' + _vr + ')?)'
588 - _cpv = '(' + _cp + '-' + _vr + ')'
589 - _pv = '(?P<pn>' + _pkg + '(?P<pn_inval>-' + _vr + ')?)' + '-(?P<ver>' + _v + ')(-r(?P<rev>' + _rev + '))?'
590 + _cp = {
591 + "dots_disallowed_in_PN": '(' + _cat + '/' + _pkg['dots_disallowed_in_PN'] + '(-' + _vr + ')?)',
592 + "dots_allowed_in_PN": '(' + _cat + '/' + _pkg['dots_allowed_in_PN'] + '(-' + _vr + ')?)',
593 + }
594 + _cpv = {
595 + "dots_disallowed_in_PN": '(' + _cp['dots_disallowed_in_PN'] + '-' + _vr + ')',
596 + "dots_allowed_in_PN": '(' + _cp['dots_allowed_in_PN'] + '-' + _vr + ')',
597 + }
598 + _pv = {
599 + "dots_disallowed_in_PN": '(?P<pn>' + _pkg['dots_disallowed_in_PN'] + '(?P<pn_inval>-' + _vr + ')?)' + '-(?P<ver>' + _v + ')(-r(?P<rev>' + _rev + '))?',
600 + "dots_allowed_in_PN": '(?P<pn>' + _pkg['dots_allowed_in_PN'] + '(?P<pn_inval>-' + _vr + ')?)' + '-(?P<ver>' + _v + ')(-r(?P<rev>' + _rev + '))?',
601 + }
602
603 ver_regexp = re.compile("^" + _vr + "$")
604 suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$")
605 @@@ -199,44 -230,18 +231,42 @@@ def vercmp(ver1, ver2, silent=1)
606 r2 = 0
607 rval = (r1 > r2) - (r1 < r2)
608 if rval:
609 - vercmp_cache[mykey] = rval
610 return rval
611
612 - # the suffix part is equal to, so finally check the revision
613 + # The suffix part is equal too, so finally check the revision
614 + # PREFIX hack: a revision starting with 0 is an 'inter-revision',
615 + # which means that it is possible to create revisions on revisions.
616 + # An example is -r01.1 which is the first revision of -r1. Note
617 + # that a period (.) is used to separate the real revision and the
618 + # secondary revision number. This trick is in use to allow revision
619 + # bumps in ebuilds synced from the main tree for Prefix changes,
620 + # while still staying in the main tree versioning scheme.
621 if match1.group(10):
622 - r1 = int(match1.group(10))
623 + if match1.group(10)[0] == '0' and '.' in match1.group(10):
624 + t = match1.group(10)[1:].split(".")
625 + r1 = int(t[0])
626 + r3 = int(t[1])
627 + else:
628 + r1 = int(match1.group(10))
629 + r3 = 0
630 else:
631 r1 = 0
632 + r3 = 0
633 if match2.group(10):
634 - r2 = int(match2.group(10))
635 + if match2.group(10)[0] == '0' and '.' in match2.group(10):
636 + t = match2.group(10)[1:].split(".")
637 + r2 = int(t[0])
638 + r4 = int(t[1])
639 + else:
640 + r2 = int(match2.group(10))
641 + r4 = 0
642 else:
643 r2 = 0
644 + r4 = 0
645 + if r1 == r2 and (r3 != 0 or r4 != 0):
646 + r1 = r3
647 + r2 = r4
648 rval = (r1 > r2) - (r1 < r2)
649 - vercmp_cache[mykey] = rval
650 return rval
651
652 def pkgcmp(pkg1, pkg2):