Merge remote branch 'overlays-gentoo-org/master' into prefix
authorFabian Groffen <grobian@gentoo.org>
Sat, 7 Aug 2010 18:45:08 +0000 (20:45 +0200)
committerFabian Groffen <grobian@gentoo.org>
Sat, 7 Aug 2010 18:45:08 +0000 (20:45 +0200)
Conflicts:
bin/dispatch-conf
bin/ebuild.sh
bin/misc-functions.sh
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/config.py

13 files changed:
1  2 
bin/dispatch-conf
bin/ebuild.sh
bin/misc-functions.sh
bin/quickpkg
bin/repoman
man/emerge.1
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/_emerge/main.py
pym/portage/dbapi/vartree.py
pym/portage/package/ebuild/config.py
pym/portage/package/ebuild/doebuild.py
pym/portage/package/ebuild/fetch.py

index 54134c1c1c23a3e8337537ed61654adf3a63b8d1,1e21a521b100075d3843e82a8e24200f39554316..0cd4b0e0312781aa7101799d8cdb5295a1675c85
  
  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 f81cb5db5fe160af49cfac42b521f8bc318c893f,2affc923a38b7afe37b35e803663c6645fb28303..b6599341dd30e07357389404d1072175b39e0d87
@@@ -485,7 -479,12 +485,12 @@@ econf() 
  
        : ${ECONF_SOURCE:=.}
        if [ -x "${ECONF_SOURCE}/configure" ]; then
 -              if [ -e /usr/share/gnuconfig/ ]; 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 "${EPREFIX}"/usr/share/gnuconfig/ ]; then
                        find "${WORKDIR}" -type f '(' \
                        -name config.guess -o -name config.sub ')' -print0 | \
                        while read -d $'\0' x ; do
index 435bdb0f5a978b37a23f3ca115ee8b90f62398a6,10d1931249615b7c76bda96ecab0aaf90aafd421..3c2277d6119be1329493dbe90b8cb06fc02d77b2
mode 100644,100755..100644
@@@ -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
  
        # this should help to ensure that all (most?) shared libraries are executable
        # and that all libtool scripts / static libraries are not executable
 -      for i in "${D}"opt/*/lib{,32,64} \
 -               "${D}"lib{,32,64}       \
 -               "${D}"usr/lib{,32,64}   \
 -               "${D}"usr/X11R6/lib{,32,64} ; do
+       local j
 +      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
        # the static library, or gcc will utilize the static lib when linking :(.
        # http://bugs.gentoo.org/4411
        abort="no"
 -      for a in "${D}"usr/lib*/*.a ; do
 -              s=${a%.a}.so
+       local a s
 +      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
                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 bin/quickpkg
Simple merge
diff --cc bin/repoman
Simple merge
diff --cc man/emerge.1
Simple merge
Simple merge
index a4e52481d8b328bb8b742191a9f203bb89e95efc,e0e215cf2f9a1b68aeba05b8a50a90558a76b7ca..8ff62829286d0d9dafbe1ed19443640abeb664a0
@@@ -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
Simple merge
index 884f747d2c4845c46034fae21e87803a882411ff,db76e0454adc0a28df4d60b03c93fa95486462df..6e4a4abb021a56f95a61cb7765b452853cf1b062
@@@ -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, \
index a2183f287b18837ee9392a3669ba999f8881297c,0540151a0e73c6851b075071fc0a27df3ef8f4b0..9927c9744ddad34bc691f721657186d18b891d14
@@@ -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
index 57b36db279814b5f8373ade5ba7e337e1e5cdf17,b95980539a6b86f1b4e0a6f707b3996586b65223..a653fb0a5ef3b15688a246b74aba72364d7cf21b
@@@ -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: