From: Fabian Groffen Date: Fri, 6 Jul 2012 07:02:23 +0000 (+0200) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f028e1bfb2b97990b558b0c1a8782838aeae175c;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/dohtml.py bin/ebuild bin/ebuild-helpers/ecompressdir bin/ebuild-helpers/prepstrip bin/ebuild-ipc.py bin/egencache bin/emaint bin/emerge bin/misc-functions.sh bin/quickpkg pym/_emerge/actions.py pym/portage/dbapi/vartree.py pym/portage/dispatch_conf.py --- f028e1bfb2b97990b558b0c1a8782838aeae175c diff --cc bin/dohtml.py index 18095bdb7,3e80ef5f6..59d388b10 --- a/bin/dohtml.py +++ b/bin/dohtml.py @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 1999-2006 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # diff --cc bin/ebuild index 599cc6cde,65e5bef63..04cb4c608 --- a/bin/ebuild +++ b/bin/ebuild @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python -O +#!@PREFIX_PORTAGE_PYTHON@ -O - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function diff --cc bin/ebuild-helpers/ecompressdir index 58c410ec7,6801a07d4..bf76b1f1a --- a/bin/ebuild-helpers/ecompressdir +++ b/bin/ebuild-helpers/ecompressdir @@@ -2,7 -2,7 +2,7 @@@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 - source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh ++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh if [[ -z $1 ]] ; then helpers_die "${0##*/}: at least one argument needed" diff --cc bin/ebuild-helpers/prepstrip index 0042abe34,85d5d6a86..22cb72e00 --- a/bin/ebuild-helpers/prepstrip +++ b/bin/ebuild-helpers/prepstrip @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 - source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh ++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh # avoid multiple calls to `has`. this creates things like: # FEATURES_foo=false diff --cc bin/ebuild-ipc.py index f95bac80f,3caf2d185..7533c8cdc --- a/bin/ebuild-ipc.py +++ b/bin/ebuild-ipc.py @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 2010-2011 Gentoo Foundation + # Copyright 2010-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # # This is a helper which ebuild processes can use diff --cc bin/egencache index 01f8e1d04,a75a34172..5edb180dd --- a/bin/egencache +++ b/bin/egencache @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 2009-2011 Gentoo Foundation + # Copyright 2009-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@@ -42,8 -42,7 +42,8 @@@ from portage.manifest import guessManif from portage.util import cmp_sort_key, writemsg_level from portage import cpv_getkey from portage.dep import Atom, isjustname - from portage.versions import pkgcmp, pkgsplit, vercmp + from portage.versions import pkgsplit, vercmp +from portage.const import EPREFIX try: from xml.etree import ElementTree diff --cc bin/emaint index 91d68d577,cf2ccb8ec..4d8b4f345 --- a/bin/emaint +++ b/bin/emaint @@@ -1,5 -1,6 +1,6 @@@ -#!/usr/bin/python -O +#!@PREFIX_PORTAGE_PYTHON@ -O - # vim: noet : + # Copyright 2005-2012 Gentoo Foundation + # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function diff --cc bin/emerge index 324f67382,a9a56432c..85154fbf1 --- a/bin/emerge +++ b/bin/emerge @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 2006-2011 Gentoo Foundation + # Copyright 2006-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function @@@ -26,16 -27,21 +27,22 @@@ except KeyboardInterrupt def debug_signal(signum, frame): import pdb pdb.set_trace() - signal.signal(signal.SIGUSR1, debug_signal) + + if platform.python_implementation() == 'Jython': + debug_signum = signal.SIGUSR2 # bug #424259 + else: + debug_signum = signal.SIGUSR1 + + signal.signal(debug_signum, debug_signal) -try: - from _emerge.main import emerge_main -except ImportError: - from os import path as osp - import sys - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - from _emerge.main import emerge_main +# for an explanation on this logic, see pym/_emerge/__init__.py +from os import environ as ose +from os import path as osp +if ose.__contains__("PORTAGE_PYTHONPATH"): + sys.path.insert(0, ose["PORTAGE_PYTHONPATH"]) +else: + sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp. realpath(__file__))), "pym")) +from _emerge.main import emerge_main if __name__ == "__main__": import sys diff --cc bin/misc-functions.sh index a7a18e23f,9eec8bb69..496c2d741 mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@@ -153,11 -150,9 +153,11 @@@ prepcompress() install_qa_check() { local f i qa_var x [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) local ED=${D} ;; esac + case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac - cd "${ED}" || die "cd failed" + # PREFIX LOCAL: ED needs not to exist, whereas D does + cd "${D}" || die "cd failed" + # END PREFIX LOCAL # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since # QA_DT_HASH is deprecated. @@@ -276,7 -271,7 +276,9 @@@ fi # Now we look for all world writable files. -- local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${ED}:- :") ++ # PREFIX LOCAL: keep offset in the paths ++ local unsafe_files=$(find "${ED}" -type f -perm -2 | sed -e "s:^${D}:- :") ++ # END PREFIX LOCAL if [[ -n ${unsafe_files} ]] ; then vecho "QA Security Notice: world writable file(s):" vecho "${unsafe_files}" @@@ -586,12 -509,36 +551,40 @@@ install_qa_check_elf() PORTAGE_QUIET=${tmp_quiet} fi + + # Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is + # too useful not to have (it's required for things like preserve-libs), and + # it's tempting for ebuild authors to set RESTRICT=binchecks for packages + # containing pre-built binaries. + if type -P scanelf > /dev/null ; then + # Save NEEDED information after removing self-contained providers + rm -f "$PORTAGE_BUILDDIR"/build-info/NEEDED{,.ELF.2} + scanelf -qyRF '%a;%p;%S;%r;%n' "${D}" | { while IFS= read -r l; do + arch=${l%%;*}; l=${l#*;} + obj="/${l%%;*}"; l=${l#*;} + soname=${l%%;*}; l=${l#*;} + rpath=${l%%;*}; l=${l#*;}; [ "${rpath}" = " - " ] && rpath="" + needed=${l%%;*}; l=${l#*;} + echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED + echo "${arch:3};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2 + done } + + [ -n "${QA_SONAME_NO_SYMLINK}" ] && \ + echo "${QA_SONAME_NO_SYMLINK}" > \ + "${PORTAGE_BUILDDIR}"/build-info/QA_SONAME_NO_SYMLINK + + if has binchecks ${RESTRICT} && \ + [ -s "${PORTAGE_BUILDDIR}/build-info/NEEDED.ELF.2" ] ; then + eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:" + eqawarn "$(while read -r x; do x=${x#*;} ; x=${x%%;*} ; echo "${x#${EPREFIX}}" ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)" + fi + fi +} - local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ED}:/:") +install_qa_check_misc() { + # PREFIX LOCAL: keep offset prefix in the reported files + local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${D}:/:") + # END PREFIX LOCAL if [[ -n ${unsafe_files} ]] ; then eqawarn "QA Notice: Unsafe files detected (set*id and world writable)" eqawarn "${unsafe_files}" diff --cc bin/quickpkg index fb7f87466,a6bd4d4bd..83c0d7b92 --- a/bin/quickpkg +++ b/bin/quickpkg @@@ -1,5 -1,5 +1,5 @@@ -#!/usr/bin/python +#!@PREFIX_PORTAGE_PYTHON@ - # Copyright 1999-2010 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function diff --cc cnf/make.globals index 2e2171d32,db97d8b5a..7e6132575 --- a/cnf/make.globals +++ b/cnf/make.globals @@@ -141,12 -123,12 +146,12 @@@ PORTAGE_WORKDIR_MODE="0700 PORTAGE_ELOG_CLASSES="log warn error" PORTAGE_ELOG_SYSTEM="save_summary echo" -PORTAGE_ELOG_MAILURI="root" +PORTAGE_ELOG_MAILURI="@rootuser@" PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}" -PORTAGE_ELOG_MAILFROM="portage@localhost" +PORTAGE_ELOG_MAILFROM="@portageuser@@localhost" # Signing command used by repoman - PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --clearsign --yes --default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" \"\${FILE}\"" + PORTAGE_GPG_SIGNING_COMMAND="gpg --sign --digest-algo SHA512 --clearsign --yes --default-key \"\${PORTAGE_GPG_KEY}\" --homedir \"\${PORTAGE_GPG_DIR}\" \"\${FILE}\"" # ***************************** # ** DO NOT EDIT THIS FILE ** diff --cc pym/_emerge/Package.py index f81895189,14d069449..228cd965d --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@@ -8,12 -8,11 +8,12 @@@ from portage import _encodings, _unicod from portage.cache.mappings import slot_dict_class from portage.const import EBUILD_PHASES from portage.dep import Atom, check_required_use, use_reduce, \ - paren_enclose, _slot_re, _slot_separator, _repo_separator - from portage.eapi import eapi_has_iuse_defaults, eapi_has_required_use + paren_enclose, _slot_separator, _repo_separator + from portage.versions import _pkg_str, _unknown_repo + from portage.eapi import _get_eapi_attrs from portage.exception import InvalidDependString - from portage.repository.config import _gen_valid_repo from _emerge.Task import Task +from portage.const import EPREFIX if sys.hexversion >= 0x3000000: basestring = str diff --cc pym/_emerge/actions.py index eb7408592,af42828d1..2135f09ce --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@@ -28,10 -28,10 +28,11 @@@ portage.proxy.lazyimport.lazyimport(glo from portage.localization import _ from portage import os from portage import shutil - from portage import _unicode_decode + from portage import eapi_is_supported, _unicode_decode from portage.cache.cache_errors import CacheError - from portage.const import GLOBAL_CONFIG_PATH, EPREFIX - from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG ++from portage.const import EPREFIX + from portage.const import GLOBAL_CONFIG_PATH + from portage.const import _ENABLE_DYN_LINK_MAP from portage.dbapi.dep_expand import dep_expand from portage.dbapi._expand_new_virt import expand_new_virt from portage.dep import Atom, extended_cp_match diff --cc pym/portage/_sets/files.py index 7992b82d0,b891ea4f4..69bdc0d77 --- a/pym/portage/_sets/files.py +++ b/pym/portage/_sets/files.py @@@ -1,6 -1,7 +1,6 @@@ - # Copyright 2007-2011 Gentoo Foundation + # Copyright 2007-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -import errno import re from itertools import chain diff --cc pym/portage/const.py index cd8ecfb30,ceef5c56b..267798c6c --- a/pym/portage/const.py +++ b/pym/portage/const.py @@@ -1,12 -1,7 +1,12 @@@ # portage: Constants - # Copyright 1998-2011 Gentoo Foundation + # Copyright 1998-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 +# =========================================================================== +# autotool supplied constants. +# =========================================================================== +from portage.const_autotool import * + import os # =========================================================================== @@@ -125,10 -90,10 +125,11 @@@ SUPPORTED_FEATURES = frozenset( "ccache", "chflags", "clean-logs", "collision-protect", "compress-build-logs", "compressdebug", "config-protect-if-modified", - "digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot", + "digest", "distcc", "distcc-pump", "distlocks", + "downgrade-backup", "ebuild-locks", "fakeroot", "fail-clean", "force-mirror", "force-prefix", "getbinpkg", "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror", + "macossandbox", "macosprefixsandbox", "macosusersandbox", "metadata-transfer", "mirror", "multilib-strict", "news", "noauto", "noclean", "nodoc", "noinfo", "noman", "nostrip", "notitles", "parallel-fetch", "parallel-install", diff --cc pym/portage/dbapi/bintree.py index 77ab4dfd2,1048cc108..170ed18ab --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@@ -23,9 -23,8 +23,9 @@@ from portage.cache.mappings import slot from portage.const import CACHE_PATH from portage.dbapi.virtual import fakedbapi from portage.dep import Atom, use_reduce, paren_enclose - from portage.exception import AlarmSignal, InvalidPackageName, \ + from portage.exception import AlarmSignal, InvalidData, InvalidPackageName, \ PermissionDenied, PortageException +from portage.const import EAPI from portage.localization import _ from portage import _movefile from portage import os diff --cc pym/portage/dbapi/vartree.py index 340de4c68,fbf2e747c..109545ad5 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@@ -30,11 -32,8 +32,11 @@@ portage.proxy.lazyimport.lazyimport(glo 'portage.util.movefile:movefile', 'portage.util._dyn_libs.PreservedLibsRegistry:PreservedLibsRegistry', 'portage.util._dyn_libs.LinkageMapELF:LinkageMapELF@LinkageMap', + 'portage.util._dyn_libs.LinkageMapMachO:LinkageMapMachO', + 'portage.util._dyn_libs.LinkageMapPeCoff:LinkageMapPeCoff', + 'portage.util._dyn_libs.LinkageMapXCoff:LinkageMapXCoff', - 'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,pkgcmp,' + \ - '_pkgsplit@pkgsplit', + 'portage.versions:best,catpkgsplit,catsplit,cpv_getkey,vercmp,' + \ + '_pkgsplit@pkgsplit,_pkg_str', 'subprocess', 'tarfile', ) @@@ -89,8 -90,10 +93,11 @@@ except ImportError if sys.hexversion >= 0x3000000: basestring = str long = int + _unicode = str + else: + _unicode = unicode + class vardbapi(dbapi): _excluded_dirs = ["CVS", "lost+found"] diff --cc pym/portage/dispatch_conf.py index 2ab7301d6,4c68dfc7b..77291958f --- a/pym/portage/dispatch_conf.py +++ b/pym/portage/dispatch_conf.py @@@ -13,8 -13,7 +13,8 @@@ import os, shutil, subprocess, sy import portage from portage.env.loaders import KeyValuePairFileLoader from portage.localization import _ - from portage.util import varexpand + from portage.util import shlex_split, varexpand +from portage.const import EPREFIX RCS_BRANCH = '1.1.1' RCS_LOCK = 'rcs -ko -M -l' diff --cc pym/portage/package/ebuild/doebuild.py index f35777a00,09062f9f3..2322746f7 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@@ -32,11 -33,10 +34,11 @@@ portage.proxy.lazyimport.lazyimport(glo from portage import auxdbkeys, bsd_chflags, \ eapi_is_supported, merge, os, selinux, shutil, \ - unmerge, _encodings, _parse_eapi_ebuild_head, _os_merge, \ + unmerge, _encodings, _os_merge, \ _shell_quote, _unicode_decode, _unicode_encode from portage.const import EBUILD_SH_ENV_FILE, EBUILD_SH_ENV_DIR, \ - EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY + EBUILD_SH_BINARY, INVALID_ENV_FILE, MISC_SH_BINARY, \ + EPREFIX, MACOSSANDBOX_PROFILE from portage.data import portage_gid, portage_uid, secpass, \ uid, userpriv_groups from portage.dbapi.porttree import _parse_uri_map diff --cc pym/portage/tests/runTests index 223a8ccd4,91984a3a3..afb967cb3 --- a/pym/portage/tests/runTests +++ b/pym/portage/tests/runTests @@@ -1,6 -1,6 +1,6 @@@ -#!/usr/bin/python -Wd +#!/usr/bin/env python # runTests.py -- Portage Unit Test Functionality - # Copyright 2006 Gentoo Foundation + # Copyright 2006-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import os, sys diff --cc pym/portage/versions.py index f0619be9f,5893096d1..81f7559b3 --- a/pym/portage/versions.py +++ b/pym/portage/versions.py @@@ -26,16 -39,27 +39,28 @@@ _cat = r'[\w+][\w+.-]* # 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-]. # It must not begin with a hyphen, # and must not end in a hyphen followed by one or more digits. - _pkg = r'[\w+][\w+-]*?' + _pkg = { + "dots_disallowed_in_PN": r'[\w+][\w+-]*?', + "dots_allowed_in_PN": r'[\w+][\w+.-]*?', + } _v = r'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)' -_rev = r'\d+' +# PREFIX hack: -r(\d+) -> -r(\d+|0\d+\.\d+) (see below) +_rev = r'(\d+|0\d+\.\d+)' _vr = _v + '(-r(' + _rev + '))?' - _cp = '(' + _cat + '/' + _pkg + '(-' + _vr + ')?)' - _cpv = '(' + _cp + '-' + _vr + ')' - _pv = '(?P' + _pkg + '(?P-' + _vr + ')?)' + '-(?P' + _v + ')(-r(?P' + _rev + '))?' + _cp = { + "dots_disallowed_in_PN": '(' + _cat + '/' + _pkg['dots_disallowed_in_PN'] + '(-' + _vr + ')?)', + "dots_allowed_in_PN": '(' + _cat + '/' + _pkg['dots_allowed_in_PN'] + '(-' + _vr + ')?)', + } + _cpv = { + "dots_disallowed_in_PN": '(' + _cp['dots_disallowed_in_PN'] + '-' + _vr + ')', + "dots_allowed_in_PN": '(' + _cp['dots_allowed_in_PN'] + '-' + _vr + ')', + } + _pv = { + "dots_disallowed_in_PN": '(?P' + _pkg['dots_disallowed_in_PN'] + '(?P-' + _vr + ')?)' + '-(?P' + _v + ')(-r(?P' + _rev + '))?', + "dots_allowed_in_PN": '(?P' + _pkg['dots_allowed_in_PN'] + '(?P-' + _vr + ')?)' + '-(?P' + _v + ')(-r(?P' + _rev + '))?', + } ver_regexp = re.compile("^" + _vr + "$") suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") @@@ -199,44 -230,18 +231,42 @@@ def vercmp(ver1, ver2, silent=1) r2 = 0 rval = (r1 > r2) - (r1 < r2) if rval: - vercmp_cache[mykey] = rval return rval - # the suffix part is equal to, so finally check the revision + # The suffix part is equal too, so finally check the revision + # PREFIX hack: a revision starting with 0 is an 'inter-revision', + # which means that it is possible to create revisions on revisions. + # An example is -r01.1 which is the first revision of -r1. Note + # that a period (.) is used to separate the real revision and the + # secondary revision number. This trick is in use to allow revision + # bumps in ebuilds synced from the main tree for Prefix changes, + # while still staying in the main tree versioning scheme. if match1.group(10): - r1 = int(match1.group(10)) + if match1.group(10)[0] == '0' and '.' in match1.group(10): + t = match1.group(10)[1:].split(".") + r1 = int(t[0]) + r3 = int(t[1]) + else: + r1 = int(match1.group(10)) + r3 = 0 else: r1 = 0 + r3 = 0 if match2.group(10): - r2 = int(match2.group(10)) + if match2.group(10)[0] == '0' and '.' in match2.group(10): + t = match2.group(10)[1:].split(".") + r2 = int(t[0]) + r4 = int(t[1]) + else: + r2 = int(match2.group(10)) + r4 = 0 else: r2 = 0 + r4 = 0 + if r1 == r2 and (r3 != 0 or r4 != 0): + r1 = r3 + r2 = r4 rval = (r1 > r2) - (r1 < r2) - vercmp_cache[mykey] = rval return rval def pkgcmp(pkg1, pkg2):