From: Fabian Groffen Date: Sat, 7 Aug 2010 18:45:08 +0000 (+0200) Subject: Merge remote branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=d0e9a33e3a56644f41adc2ed67e9462d78fb0ae3;p=portage.git Merge remote branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/dispatch-conf bin/ebuild.sh bin/misc-functions.sh pym/portage/dbapi/vartree.py pym/portage/package/ebuild/config.py --- d0e9a33e3a56644f41adc2ed67e9462d78fb0ae3 diff --cc bin/dispatch-conf index 54134c1c1,1e21a521b..0cd4b0e03 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@@ -13,25 -13,16 +13,22 @@@ from __future__ import print_function - if not hasattr(__builtins__, "set"): - from sets import Set as set - - from stat import * - from random import * + from stat import ST_GID, ST_MODE, ST_UID + from random import random import atexit, re, shutil, stat, sys - try: - import portage + from subprocess import getoutput as subprocess_getoutput + from subprocess import getstatusoutput as subprocess_getstatusoutput except ImportError: - from os import path as osp - sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym")) - import portage + from commands import getoutput as subprocess_getoutput + from commands import getstatusoutput as subprocess_getstatusoutput +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")) +import portage from portage import os from portage import dispatch_conf @@@ -98,8 -88,8 +95,8 @@@ class dispatch # Build list of extant configs # - for path in config_paths.split (): + for path in config_paths: - path = portage.normalize_path(path) + path = portage.normalize_path(EPREFIX + path) try: mymode = os.stat(path).st_mode except OSError: diff --cc bin/ebuild.sh index f81cb5db5,2affc923a..b6599341d --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@@ -485,7 -479,12 +485,12 @@@ econf() : ${ECONF_SOURCE:=.} if [ -x "${ECONF_SOURCE}/configure" ]; then + if [[ -n $CONFIG_SHELL && \ + "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then + sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \ + die "Substition of shebang in '$ECONF_SOURCE/configure' failed" + fi - if [ -e /usr/share/gnuconfig/ ]; then + if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then find "${WORKDIR}" -type f '(' \ -name config.guess -o -name config.sub ')' -print0 | \ while read -d $'\0' x ; do diff --cc bin/misc-functions.sh index 435bdb0f5,10d193124..3c2277d61 mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@@ -60,43 -61,9 +63,43 @@@ install_qa_check() sleep 1 done + # anything outside the prefix should be caught by the Prefix QA + # check, so if there's nothing in ED, we skip searching for QA + # checks there, the specific QA funcs can hence rely on ED existing + if [[ -d ${ED} ]] ; then + case ${CHOST} in + *-darwin*) + # Mach-O platforms (NeXT, Darwin, OSX) + install_qa_check_macho + ;; + *-interix*|*-winnt*) + # PECOFF platforms (Windows/Interix) + install_qa_check_pecoff + ;; + *-aix*) + # XCOFF platforms (AIX) + install_qa_check_xcoff + ;; + *) + # because this is the majority: ELF platforms (Linux, + # Solaris, *BSD, IRIX, etc.) + install_qa_check_elf + ;; + esac + fi + + # this is basically here such that the diff with trunk remains just + # offsetted and not out of order + install_qa_check_misc + + # Prefix specific checks + [[ -n ${EPREFIX} ]] && install_qa_check_prefix +} + +install_qa_check_elf() { if type -P scanelf > /dev/null && ! hasq binchecks ${RESTRICT}; then local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET} - local f x + local x # display warnings when using stricter because we die afterwards if has stricter ${FEATURES} ; then @@@ -369,9 -334,10 +372,10 @@@ install_qa_check_misc() fi # Sanity check syntax errors in init.d scripts + local d for d in /etc/conf.d /etc/init.d ; do - [[ -d ${D}/${d} ]] || continue - for i in "${D}"/${d}/* ; do + [[ -d ${ED}/${d} ]] || continue + for i in "${ED}"/${d}/* ; do [[ -L ${i} ]] && continue # if empty conf.d/init.d dir exists (baselayout), then i will be "/etc/conf.d/*" and not exist [[ ! -e ${i} ]] && continue @@@ -381,13 -347,14 +385,14 @@@ # this should help to ensure that all (most?) shared libraries are executable # and that all libtool scripts / static libraries are not executable + local j - for i in "${D}"opt/*/lib{,32,64} \ - "${D}"lib{,32,64} \ - "${D}"usr/lib{,32,64} \ - "${D}"usr/X11R6/lib{,32,64} ; do + for i in "${ED}"opt/*/lib{,32,64} \ + "${ED}"lib{,32,64} \ + "${ED}"usr/lib{,32,64} \ + "${ED}"usr/X11R6/lib{,32,64} ; do [[ ! -d ${i} ]] && continue - for j in "${i}"/*.so.* "${i}"/*.so ; do + for j in "${i}"/*.so.* "${i}"/*.so "${i}"/*.dylib "${i}"/*.dll ; do [[ ! -e ${j} ]] && continue [[ -L ${j} ]] && continue [[ -x ${j} ]] && continue @@@ -422,10 -389,9 +427,11 @@@ # the static library, or gcc will utilize the static lib when linking :(. # http://bugs.gentoo.org/4411 abort="no" + local a s - for a in "${D}"usr/lib*/*.a ; do - s=${a%.a}.so + for a in "${ED}"usr/lib*/*.a ; do + [[ ${CHOST} == *-darwin* ]] \ + && s=${a%.a}.dylib \ + || s=${a%.a}.so if [[ ! -e ${s} ]] ; then s=${s%usr/*}${s##*/usr/} if [[ -e ${s} ]] ; then @@@ -576,29 -538,28 +582,28 @@@ fi fi - # Compiled python objects do not belong in /usr/share (FHS violation) - # and can be a pain when upgrading python - f=$([ -d "${ED}"/usr/share ] && \ - find "${ED}"usr/share -name '*.py[co]' | sed "s:${D}:/:") - f=$(find "${D}" -name '*.py[co]' | sed "s:${D}:/:") ++ f=$(find "${ED}" -name '*.py[co]' | sed "s:${D}:/:") if [[ -n ${f} ]] ; then vecho -ne '\a\n' - eqawarn "QA Notice: Precompiled python object files do not belong in /usr/share" + eqawarn "QA Notice: Byte-compiled Python modules have been found. python_mod_optimize()" + eqawarn " and python_mod_cleanup() functions python.eclass should be used to" + eqawarn " handle byte-compiled Python modules." eqawarn "${f}" vecho -ne '\a\n' fi # Portage regenerates this on the installed system. - rm -f "${D}"/usr/share/info/dir{,.gz,.bz2} + rm -f "${ED}"/usr/share/info/dir{,.gz,.bz2} if hasq multilib-strict ${FEATURES} && \ - [[ -x /usr/bin/file && -x /usr/bin/find ]] && \ + [[ -x ${EPREFIX}/usr/bin/file && -x ${EPREFIX}/usr/bin/find ]] && \ [[ -n ${MULTILIB_STRICT_DIRS} && -n ${MULTILIB_STRICT_DENY} ]] then - local abort=no firstrun=yes + local abort=no dir file firstrun=yes MULTILIB_STRICT_EXEMPT=$(echo ${MULTILIB_STRICT_EXEMPT} | sed -e 's:\([(|)]\):\\\1:g') for dir in ${MULTILIB_STRICT_DIRS} ; do - [[ -d ${D}/${dir} ]] || continue - for file in $(find ${D}/${dir} -type f | grep -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do + [[ -d ${ED}/${dir} ]] || continue + for file in $(find ${ED}/${dir} -type f | grep -v "^${ED}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do if file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" ; then if [[ ${firstrun} == yes ]] ; then echo "Files matching a file type that is not allowed:" @@@ -1330,9 -626,10 +1336,10 @@@ preinst_mask() cd "${T}" # remove man pages, info pages, docs if requested + local f for f in man info doc; do if hasq no${f} $FEATURES; then - INSTALL_MASK="${INSTALL_MASK} /usr/share/${f}" + INSTALL_MASK="${INSTALL_MASK} ${EPREFIX}/usr/share/${f}" fi done @@@ -1386,8 -683,8 +1393,8 @@@ preinst_suid_scan() fi # total suid control. if hasq suidctl $FEATURES; then - local sfconf + local i sfconf x - sfconf=${PORTAGE_CONFIGROOT}etc/portage/suidctl.conf + sfconf=${PORTAGE_CONFIGROOT}${EPREFIX#/}/etc/portage/suidctl.conf # sandbox prevents us from writing directly # to files outside of the sandbox, but this # can easly be bypassed using the addwrite() function diff --cc pym/_emerge/depgraph.py index a4e52481d,e0e215cf2..8ff628292 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@@ -5890,15 -6168,11 +6168,17 @@@ def _get_masking_status(pkg, pkgsetting if pkg.invalid: for msg_type, msgs in pkg.invalid.items(): for msg in msgs: - mreasons.append("invalid: %s" % (msg,)) + mreasons.append( + _MaskReason("invalid", "invalid: %s" % (msg,))) + if pkg.built and not pkg.installed: + if not "EPREFIX" in pkg.metadata or not pkg.metadata["EPREFIX"]: + mreasons.append("missing EPREFIX") + elif len(pkg.metadata["EPREFIX"].strip()) < len(pkgsettings["EPREFIX"]): + mreasons.append("EPREFIX: '%s' too small" % pkg.metadata["EPREFIX"]) + if not pkg.metadata["SLOT"]: - mreasons.append("invalid: SLOT is undefined") + mreasons.append( + _MaskReason("invalid", "SLOT: undefined")) return mreasons diff --cc pym/portage/dbapi/vartree.py index 884f747d2,db76e0454..6e4a4abb0 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@@ -30,8 -30,7 +31,7 @@@ portage.proxy.lazyimport.lazyimport(glo ) from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \ - PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH + PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH, EPREFIX, EPREFIX_LSTRIP, BASH_BINARY - from portage.data import portage_gid, portage_uid, secpass from portage.dbapi import dbapi from portage.exception import CommandNotFound, \ InvalidData, InvalidPackageName, \ diff --cc pym/portage/package/ebuild/config.py index a2183f287,0540151a0..9927c9744 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@@ -25,9 -28,7 +28,7 @@@ from portage.const import CACHE_PATH, C DEPCACHE_PATH, GLOBAL_CONFIG_PATH, INCREMENTALS, MAKE_CONF_FILE, \ MODULES_FILE_PATH, PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, \ PRIVATE_PATH, PROFILE_PATH, SUPPORTED_FEATURES, USER_CONFIG_PATH, \ - USER_VIRTUALS_FILE, \ - EPREFIX, EPREFIX_LSTRIP, BPREFIX - from portage.data import portage_gid - USER_VIRTUALS_FILE ++ USER_VIRTUALS_FILE, EPREFIX, EPREFIX_LSTRIP, BPREFIX from portage.dbapi import dbapi from portage.dbapi.porttree import portdbapi from portage.dbapi.vartree import vartree diff --cc pym/portage/package/ebuild/fetch.py index 57b36db27,b95980539..a653fb0a5 --- a/pym/portage/package/ebuild/fetch.py +++ b/pym/portage/package/ebuild/fetch.py @@@ -455,10 -454,8 +455,8 @@@ def fetch(myuris, mysettings, listonly= # to have root's gid. Therefore, use root's gid instead of # portage's gid to avoid spurrious permissions adjustments # when inside fakeroot. - dir_gid = 0 + dir_gid = rootgid distdir_dirs = [""] - if "distlocks" in features: - distdir_dirs.append(".locks") try: for x in distdir_dirs: