Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix
authorFabian Groffen <grobian@gentoo.org>
Fri, 9 Dec 2011 20:32:39 +0000 (21:32 +0100)
committerFabian Groffen <grobian@gentoo.org>
Fri, 9 Dec 2011 20:32:39 +0000 (21:32 +0100)
Conflicts:
bin/dispatch-conf
bin/ebuild-helpers/dobin
bin/ebuild-helpers/dodir
bin/ebuild-helpers/dodoc
bin/ebuild-helpers/doexe
bin/ebuild-helpers/dohard
bin/ebuild-helpers/doinfo
bin/ebuild-helpers/doins
bin/ebuild-helpers/dolib
bin/ebuild-helpers/domo
bin/ebuild-helpers/dosbin
bin/ebuild-helpers/dosed
bin/ebuild-helpers/dosym
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/fowners
bin/ebuild-helpers/fperms
bin/ebuild-helpers/prepalldocs
bin/ebuild-helpers/prepallinfo
bin/ebuild-helpers/prepallman
bin/ebuild-helpers/prepallstrip
bin/ebuild-helpers/prepinfo
bin/ebuild-helpers/preplib
bin/ebuild-helpers/prepstrip
bin/emerge-webrsync
bin/etc-update
bin/misc-functions.sh
bin/phase-functions.sh
bin/phase-helpers.sh
cnf/dispatch-conf.conf
cnf/make.conf
cnf/make.globals
pym/portage/data.py
pym/portage/dispatch_conf.py
pym/portage/package/ebuild/_config/special_env_vars.py
pym/portage/package/ebuild/config.py

47 files changed:
1  2 
bin/dispatch-conf
bin/ebuild-helpers/dobin
bin/ebuild-helpers/dodir
bin/ebuild-helpers/dodoc
bin/ebuild-helpers/doexe
bin/ebuild-helpers/dohard
bin/ebuild-helpers/doinfo
bin/ebuild-helpers/doins
bin/ebuild-helpers/dolib
bin/ebuild-helpers/doman
bin/ebuild-helpers/domo
bin/ebuild-helpers/dosbin
bin/ebuild-helpers/dosed
bin/ebuild-helpers/dosym
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/fowners
bin/ebuild-helpers/fperms
bin/ebuild-helpers/prepall
bin/ebuild-helpers/prepalldocs
bin/ebuild-helpers/prepallinfo
bin/ebuild-helpers/prepallman
bin/ebuild-helpers/prepallstrip
bin/ebuild-helpers/prepinfo
bin/ebuild-helpers/preplib
bin/ebuild-helpers/prepman
bin/ebuild-helpers/prepstrip
bin/ebuild.sh
bin/egencache
bin/emerge-webrsync
bin/etc-update
bin/misc-functions.sh
bin/phase-functions.sh
bin/phase-helpers.sh
bin/portageq
bin/repoman
cnf/make.conf
cnf/make.globals
man/emerge.1
man/make.conf.5
pym/_emerge/actions.py
pym/_emerge/depgraph.py
pym/portage/const.py
pym/portage/data.py
pym/portage/dispatch_conf.py
pym/portage/package/ebuild/_config/special_env_vars.py
pym/portage/package/ebuild/config.py
pym/portage/package/ebuild/doebuild.py

index 6a77f7bcec236b1486b2a08eaaf6b82cc415e9fc,1cad9e01167629395c562afda39d75e469c01b67..e639b66d854c0d42d9ec43922fbc2222c327e062
@@@ -92,7 -85,7 +92,7 @@@ class dispatch
          confs = []
          count = 0
  
-         config_root = EPREFIX
 -        config_root = os.environ.get("__PORTAGE_TEST_EPREFIX", "/")
++        config_root = os.environ.get("__PORTAGE_TEST_EPREFIX", EPREFIX)
          self.options = portage.dispatch_conf.read_config(MANDATORY_OPTS)
  
          if "log-file" in self.options:
index 8adc65d48e3b32baef3a6b29ff6830b0f35c3a6d,f90d8933c1646d059b74134fd552980dec39e33d..922e600c786597ac5974720f3dffb6956b54660f
@@@ -1,8 -1,8 +1,8 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2010 Gentoo Foundation
+ # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
  if [[ $# -lt 1 ]] ; then
        helpers_die "${0##*/}: at least one argument needed"
index 06dd2fe7216d9fe0e10c8e8de0f8ed093f9cefcf,90a3efed494a4d97b1871f60d0f74aea756a0547..f7a9c395f84b2c7c8c59288bfa06a61ee9146265
@@@ -2,11 -2,10 +2,10 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
- # PREFIX LOCAL: always support ED
- #case "$EAPI" in 0|1|2) ED=${D} ;; esac
- # END PREFIX LOCAL
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+       case "$EAPI" in 0|1|2) ED=${D} ;; esac
  
  install -d ${DIROPTIONS} "${@/#/${ED}/}"
  ret=$?
Simple merge
Simple merge
Simple merge
Simple merge
index 0eafced99744d8587783d8fab815e46cfca72d09,443bfdb21b7ebe5af472516279ba6950f525e71b..b9c95ed0fa3954712d896879601331d182f57d52
@@@ -39,13 -38,6 +38,15 @@@ if [[ ${INSDESTTREE#${ED}} != "${INSDES
        helpers_die "${0##*/} used with \${D} or \${ED}"
        exit 1
  fi
++# PREFIX LOCAL: check for usage with EPREFIX
 +if [[ ${INSDESTTREE#${EPREFIX}} != "${INSDESTTREE}" ]]; then
 +      vecho "-------------------------------------------------------" 1>&2
 +      vecho "You should not use \${EPREFIX} with helpers." 1>&2
 +      vecho "  --> ${INSDESTTREE}" 1>&2
 +      vecho "-------------------------------------------------------" 1>&2
 +      exit 1
 +fi
++# END PREFIX LOCAL
  
  case "$EAPI" in
        0|1|2|3|3_pre2)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 5c1ecac8b0d62a1ec5b9cee700e55f1f3a100023,a5a28f2fb08231f42cbcd476a91876ce306d22ed..9815d2ea681fe36fb312a11b18984003ce8b8cb7
@@@ -2,17 -2,11 +2,18 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
 +
++# PREFIX LOCAL: ignore otherwise failing call
 +if hasq prefix ${USE} && [[ $EUID != 0 ]] ; then
 +      ewarn "fowners ignored in Prefix with non-privileged user"
 +      exit 0
 +fi
- # PREFIX LOCAL: always support ED
- #case "$EAPI" in 0|1|2) ED=${D} ;; esac
 +# END PREFIX LOCAL
  
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+       case "$EAPI" in 0|1|2) ED=${D} ;; esac
  # we can't prefix all arguments because
  # chown takes random options
  slash="/"
index 25f77a9b75a4e4f2f73e599d066174246a6b7149,a2f77ea002d0c8b38f8391e144bf5be1a71ea08d..23b536173cdf89a593e65f552e27c26d7ab9f6c3
@@@ -2,11 -2,11 +2,11 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
- # PREFIX LOCAL: always support ED
#case "$EAPI" in 0|1|2) ED=${D} ;; esac
- # END PREFIX LOCAL
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
      case "$EAPI" in 0|1|2) ED=${D} ;; esac
  # we can't prefix all arguments because
  # chmod takes random options
  slash="/"
index c4e9ffccd02473d65f134e87cd7943832a565ebf,49e646cd280081c9979a4f069291cda86922698b..3aacb7f2adfb8b0a7faeaa70e0bbb8a1618d5e01
@@@ -2,11 -2,10 +2,12 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
 +
 +[[ -d ${ED} ]] || exit 0
  
- case "$EAPI" in 0|1|2) ED=${D} ;; esac
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+       case "$EAPI" in 0|1|2) ED=${D} ;; esac
  
  if has chflags $FEATURES ; then
        # Save all the file flags for restoration at the end of prepall.
Simple merge
index de52098bdf20c6a5c5e8f4d8ebaaa3563e511e92,db9bbfacb0e8f1c021c15e04402b43485cfaf551..00e1fc41cc6923dc07091845f55410abb8161afc
@@@ -2,11 -2,10 +2,10 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
- # PREFIX LOCAL: always support ED
- #case "$EAPI" in 0|1|2) ED=${D} ;; esac
- # END PREFIX LOCAL
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+       case "$EAPI" in 0|1|2) ED=${D} ;; esac
  
  [[ -d ${ED}usr/share/info ]] || exit 0
  
Simple merge
Simple merge
index c0ab9c9fb29972db9c4ce0231255ddb42bb4ef8b,ffe2ecec30bac2f77c3360fdd32bcee1e6972779..ffd504949016e63631dde0201dd6c35c9eff7def
@@@ -2,11 -2,10 +2,10 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
- # PREFIX LOCAL: always support ED
- #case "$EAPI" in 0|1|2) ED=${D} ;; esac
- # END PREFIX LOCAL
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+       case "$EAPI" in 0|1|2) ED=${D} ;; esac
  
  if [[ -z $1 ]] ; then
        infodir="/usr/share/info"
Simple merge
index 2c10b26f95325d5583694710faa17b86699fb022,f96b64147dbcccce1a65cace7f3ad0c17028e78f..1411499ab7430b438dcdbfd5c29de87ef25f6e37
@@@ -2,9 -2,10 +2,10 @@@
  # Copyright 1999-2011 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh
  
- case "$EAPI" in 0|1|2) ED=${D} ;; esac
+ [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+       case "$EAPI" in 0|1|2) ED=${D} ;; esac
  
  if [[ -z $1 ]] ; then 
        mandir="${ED}usr/share/man"
index 927078aee4223b1f3cdcb830e393932696ee33cc,15eed845784c289e82da3b39f712c8c20428d20f..84e2edcebd99038c5a369d01d7c6566e9b27eda1
                strip_this=false
        fi
  
++      # PREFIX LOCAL:
 +      # In Prefix we are usually an unprivileged user, so we can't strip
 +      # unwritable objects.  Make them temporarily writable for the
 +      # stripping.
 +      was_not_writable=false
 +      if [[ ! -w ${x} ]] ; then
 +              was_not_writable=true
 +              chmod u+w "${x}"
 +      fi
++      # END PREFIX LOCAL
 +
        # only split debug info for final linked objects
        # or kernel modules as debuginfo for intermediatary
        # files (think crt*.o from gcc/glibc) is useless and
        elif [[ ${f} == *"SB relocatable"* ]] ; then
                process_elf "${x}" ${SAFE_STRIP_FLAGS}
        fi
 +
++      # PREFIX LOCAL: see above
 +      if [[ ${was_not_writable} == "true" ]] ; then
 +              chmod u-w "${x}"
 +      fi
++      # END PREFIX LOCAL
  done
  
  if [[ -s ${T}/debug.sources ]] && \
diff --cc bin/ebuild.sh
index 2ec34cd961d389b3c575308e998d63fe08387e0c,1f95adb8215f5d469a6ea10939488c3deb87ff8c..7511532381fa52c50b040eb9fe37d3a913b2a9e2
@@@ -669,11 -670,11 +670,13 @@@ els
        declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS
        case "$EAPI" in
                0|1|2)
+                       [[ " ${FEATURES} " == *" force-prefix "* ]] && \
+                               declare -r ED EPREFIX EROOT
                        ;;
                *)
 -                      declare -r ED EPREFIX EROOT
 +                      # PREFIX LOCAL: allow prefix vars in any EAPI
 +                      #declare -r ED EPREFIX EROOT
 +                      # PREFIX LOCAL
                        ;;
        esac
  
diff --cc bin/egencache
Simple merge
index c5809cce5ee514985f727ac37aaa8bf20e6ad529,e6749f28504668a0bebcf8c70fdfe98593e06e6b..c41eb79358e384242a1a048ab662a068eba613b6
@@@ -39,10 -38,6 +39,11 @@@ eval $(portageq envvar -v FEATURES FETC
  DISTDIR="${PORTAGE_TMPDIR}/emerge-webrsync"
  export http_proxy ftp_proxy
  
- # PREFIX HACK: use Prefix servers, just because we want this and infra
++# PREFIX LOCAL: use Prefix servers, just because we want this and infra
 +# just can't support us yet
 +GENTOO_MIRRORS="http://gentoo-mirror1.prefix.freens.org http://gentoo-mirror2.prefix.freens.org"
++# END PREFIX LOCAL
 +
  # If PORTAGE_NICENESS is overriden via the env then it will
  # still pass through the portageq call and override properly.
  if [ -n "${PORTAGE_NICENESS}" ]; then
@@@ -183,8 -178,8 +184,10 @@@ sync_local() 
        vecho "Syncing local tree ..."
  
        if type -P tarsync > /dev/null ; then
 -              local chown_opts="-o portage -g portage"
 -              chown portage:portage portage > /dev/null 2>&1 || chown_opts=""
++              # PREFIX LOCAL: use PORTAGE_USER and PORTAGE_GROUP
 +              local chown_opts="-o ${PORTAGE_USER:-portage} -g ${PORTAGE_GROUP:-portage}"
 +              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} portage > /dev/null 2>&1 || chown_opts=""
++              # END PREFIX LOCAL
                if ! tarsync $(vvecho -v) -s 1 ${chown_opts} \
                        -e /distfiles -e /packages -e /local "${file}" "${PORTDIR}"; then
                        eecho "tarsync failed; tarball is corrupt? (${file})"
                # Free disk space
                rm -f "${file}"
  
 -              chown portage:portage portage > /dev/null 2>&1 && \
 -                      chown -R portage:portage portage
++              # PREFIX LOCAL: use PORTAGE_USER and PORTAGE_GROUP
 +              chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} portage > /dev/null 2>&1 && \
 +                      chown -R ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} portage
++              # END PREFIX LOCAL
                cd portage
                rsync -av --progress --stats --delete --delete-after \
                        --exclude='/distfiles' --exclude='/packages' \
                vecho "Updating cache ..."
                emerge --metadata
        fi
 -      [ -x /etc/portage/bin/post_sync ] && /etc/portage/bin/post_sync
 +      [ -x "${EPREFIX}"/etc/portage/bin/post_sync ] && "${EPREFIX}"/etc/portage/bin/post_sync
+       # --quiet suppresses output if there are no relevant news items
+       has news ${FEATURES} && emerge --check-news --quiet
        return 0
  }
  
diff --cc bin/etc-update
index c735076d6211fa41e07a8a1c4819144d2e447049,731b6484e643d1b2cb2dcbf1d1dda8b0135a99a4..b3877fbea8788320c0b6eb8481a455dfef5ae9e1
@@@ -555,16 -555,12 +555,12 @@@ rm -rf "${TMP}" 2> /dev/nul
  mkdir "${TMP}" || die "failed to create temp dir" 1
  # make sure we have a secure directory to work in
  chmod 0700 "${TMP}" || die "failed to set perms on temp dir" 1
- # GID need not to be available, and group 0 is not cool when not being
- # root, hence just rely on mkdir to have created a dir which is owned by
- # the user
- if [[ -z ${UID} || ${UID} == 0 ]] ; then
-       chown ${UID:-0}:${GID:-0} "${TMP}" || die "failed to set ownership on temp dir" 1
- fi
+ chown ${PORTAGE_INST_UID:-0}:${PORTAGE_INST_GID:-0} "${TMP}" || \
+       die "failed to set ownership on temp dir" 1
  
  # I need the CONFIG_PROTECT value
 -#CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT)
 -#CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK)
 +#CONFIG_PROTECT=$(@PORTAGE_BASE@/bin/portageq envvar CONFIG_PROTECT)
 +#CONFIG_PROTECT_MASK=$(@PORTAGE_BASE@/bin/portageq envvar CONFIG_PROTECT_MASK)
  
  # load etc-config's configuration
  CLEAR_TERM=$(get_config clear_term)
index 20d52a79a25196c3aa00843a24b5d05dccb5174d,358288932cb908d9aac4f89f94b4816c934390d6..1e3785c5431a4af24bc55a071c23bfa491a369a9
mode 100644,100755..100644
  MISC_FUNCTIONS_ARGS="$@"
  shift $#
  
 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
 +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}/ebuild.sh"
  
  install_symlink_html_docs() {
-       # PREFIX LOCAL: always support ED
-       #case "$EAPI" in 0|1|2) local ED=${D} ;; esac
-       # END PREFIX LOCAL
-       # PREFIX LOCAL: ED need not to exist, whereas D does
-       [[ ! -d ${ED} ]] && dodir /
+       [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+               case "$EAPI" in 0|1|2) local ED=${D} ;; esac
++      # PREFIX LOCAL: ED needs not to exist, whereas D does
++      [[ ! -d ${ED} && -d ${D} ]] && dodir /
 +      # END PREFIX LOCAL
        cd "${ED}" || die "cd failed"
        #symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf)
        if [ -n "${DOC_SYMLINKS_DIR}" ] ; then
@@@ -154,13 -149,10 +152,12 @@@ prepcompress() 
  
  install_qa_check() {
        local f i x
-       # PREFIX LOCAL: always support ED
-       #case "$EAPI" in 0|1|2) local ED=${D} ;; esac
-       # END PREFIX LOCAL
+       [[ " ${FEATURES} " == *" force-prefix "* ]] || \
+               case "$EAPI" in 0|1|2) local 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
  
        export STRIP_MASK
        prepall
                sleep 1
        fi
  
++      # PREFIX LOCAL:
 +      # 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
++      # END PREFIX LOCAL
 +}
 +
 +install_qa_check_elf() {
        if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT}; then
                local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET}
                local x
index 97111f52547ba991b484e412268f5ec55a529703,482b5b1708f848e84eb9896849db66e5d3043f59..75f166473e253f4d201b7ca3aaa77e69c749a871
@@@ -28,7 -28,7 +28,7 @@@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_
        PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \
        PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \
        PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \
-       ED EROOT"
 -      __PORTAGE_TEST_EPREFIX"
++      __PORTAGE_TEST_EPREFIX ED EROOT"
  
  PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR"
  
@@@ -558,7 -559,20 +559,24 @@@ dyn_install() 
        fi
        echo "${USE}"       > USE
        echo "${EAPI:-0}"   > EAPI
++<<<<<<< HEAD
 +      echo "${EPREFIX}"   > EPREFIX
++=======
+       # Save EPREFIX, since it makes it easy to use chpathtool to
+       # adjust the content of a binary package so that it will
+       # work in a different EPREFIX from the one is was built for.
+       case "${EAPI:-0}" in
+               0|1|2)
+                       [[ " ${FEATURES} " == *" force-prefix "* ]] && \
+                               [ -n "${EPREFIX}" ] && echo "${EPREFIX}" > EPREFIX
+                       ;;
+               *)
+                       [ -n "${EPREFIX}" ] && echo "${EPREFIX}" > EPREFIX
+                       ;;
+       esac
++>>>>>>> overlays-gentoo-org/master
        set +f
  
        # local variables can leak into the saved environment.
Simple merge
diff --cc bin/portageq
Simple merge
diff --cc bin/repoman
Simple merge
diff --cc cnf/make.conf
index 25488d38019fc54a56c936b92d21f717075e2a56,ef570bcb417cc35e07d3aa6f13c8aa9155ecead4..5134188e92828ccd6d6d2606a1e97b344d42c626
  # at \${DISTDIR}/\${FILE}.
  #
  # Default fetch command (3 tries, passive ftp for firewall compatibility)
- #FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
- #RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+ #FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+ #RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
  #
  # Using wget, ratelimiting downloads
- #FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -t 3 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
- #RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/wget -c -t 3 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
- #
- # curl groks urls
- #FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}"
- #RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}"
+ #FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
+ #RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp --limit-rate=200k -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
  #
  # Lukemftp (BSD ftp):
- #FETCHCOMMAND="@PORTAGE_EPREFIX@/usr/bin/lukemftp -s -a -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
- #RESUMECOMMAND="@PORTAGE_EPREFIX@/usr/bin/lukemftp -s -a -R -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
 -#FETCHCOMMAND="/usr/bin/lukemftp -s -a -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
 -#RESUMECOMMAND="/usr/bin/lukemftp -s -a -R -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
++#FETCHCOMMAND="lukemftp -s -a -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
++#RESUMECOMMAND="lukemftp -s -a -R -o \"\${DISTDIR}/\${FILE}\" \"\${URI}\""
  #
  # Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval.
  # The list is a space separated list which is read left to right. If you use
Simple merge
diff --cc man/emerge.1
Simple merge
diff --cc man/make.conf.5
Simple merge
Simple merge
Simple merge
index 63e7c67da808082e0dd896c0b45a96268f96dfbe,5eeebe1308c2715aeb7537d5e22d027a5463aac8..336c005cecceecd766e1ca882ca664fa471d3b25
@@@ -134,9 -90,8 +134,9 @@@ SUPPORTED_FEATURES       = frozenset(
                             "ccache", "chflags", "clean-logs",
                             "collision-protect", "compress-build-logs",
                             "digest", "distcc", "distcc-pump", "distlocks", "ebuild-locks", "fakeroot",
-                            "fail-clean", "force-mirror", "getbinpkg",
+                            "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",
index 354fc9c6e57f7bf4d719d65057e114874bc18667,fa6970c42f198b587d796e83e38ff81e980f94f9..e8a0a3ab00500827771eb65a981763c0158f9919
@@@ -77,71 -66,117 +75,131 @@@ try
  except KeyError:
        pass
  
- # Allow the overriding of the user used for 'userpriv' and 'userfetch'
- _portage_uname = os.environ.get('PORTAGE_USERNAME', PORTAGE_USERNAME)
- _portage_grpname = os.environ.get('PORTAGE_GRPNAME', PORTAGE_GROUPNAME)
- #Discover the uid and gid of the portage user/group
- try:
-       portage_gid = grp.getgrnam(_portage_grpname)[2]
- except KeyError:
-       # some sysadmins are insane, bug #344307
-       if _portage_grpname.isdigit():
-               portage_gid = int(_portage_grpname)
+ # The portage_uid and portage_gid global constants, and others that
+ # depend on them are initialized lazily, in order to allow configuration
+ # via make.conf. Eventually, these constants may be deprecated in favor
+ # of config attributes, since it's conceivable that multiple
+ # configurations with different constants could be used simultaneously.
+ _initialized_globals = set()
+ def _get_global(k):
+       if k in _initialized_globals:
+               return globals()[k]
+       if k in ('portage_gid', 'portage_uid', 'secpass'):
+               global portage_gid, portage_uid, secpass
+               secpass = 0
+               if uid == 0:
+                       secpass = 2
+               elif "__PORTAGE_TEST_EPREFIX" in os.environ:
+                       secpass = 2
+               #Discover the uid and gid of the portage user/group
+               try:
 -                      portage_uid = pwd.getpwnam(_get_global('_portage_uname'))[2]
+                       portage_gid = grp.getgrnam(_get_global('_portage_grpname'))[2]
++              except KeyError:
++                      # some sysadmins are insane, bug #344307
++                      if _get_global('_portage_grpname').isdigit():
++                              portage_gid = int(_get_global('_portage_grpname'))
++                      else:
++                              portage_gid = None
++              try:
++                      portage_uid = pwd.getpwnam(_get_global('_portage_uname'))[2]
+                       if secpass < 1 and portage_gid in os.getgroups():
+                               secpass = 1
+               except KeyError:
++                      portage_uid = None
++
++              if portage_uid is None or portage_gid is None:
+                       portage_uid = 0
+                       portage_gid = 0
++                      # PREFIX LOCAL: we need to fix this one day to distinguish prefix vs non-prefix
++                      writemsg(colorize("BAD",
++                              _("portage: '%s' user or '%s' group missing." % (_get_global('_portage_uname'), _get_global('_portage_grpname')))) + "\n", noiselevel=-1)
++                      writemsg(colorize("BAD",
++                              _("         In Prefix Portage this is quite dramatic")) + "\n", noiselevel=-1)
+                       writemsg(colorize("BAD",
 -                              _("portage: 'portage' user or group missing.")) + "\n", noiselevel=-1)
 -                      writemsg(_(
 -                              "         For the defaults, line 1 goes into passwd, "
 -                              "and 2 into group.\n"), noiselevel=-1)
 -                      writemsg(colorize("GOOD",
 -                              "         portage:x:250:250:portage:/var/tmp/portage:/bin/false") \
 -                              + "\n", noiselevel=-1)
 -                      writemsg(colorize("GOOD", "         portage::250:portage") + "\n",
 -                              noiselevel=-1)
++                              _("         since it means you have thrown away yourself.")) + "\n", noiselevel=-1)
++                      writemsg(colorize("BAD",
++                              _("         Re-add yourself or re-bootstrap Gentoo Prefix.")) + "\n", noiselevel=-1)
++                      # END PREFIX LOCAL
+                       portage_group_warning()
+               _initialized_globals.add('portage_gid')
+               _initialized_globals.add('portage_uid')
+               _initialized_globals.add('secpass')
+               if k == 'portage_gid':
+                       return portage_gid
+               elif k == 'portage_uid':
+                       return portage_uid
+               elif k == 'secpass':
+                       return secpass
+               else:
+                       raise AssertionError('unknown name: %s' % k)
+       elif k == 'userpriv_groups':
+               v = [portage_gid]
+               if secpass >= 2:
+                       # Get a list of group IDs for the portage user. Do not use
+                       # grp.getgrall() since it is known to trigger spurious
+                       # SIGPIPE problems with nss_ldap.
+                       mystatus, myoutput = \
+                               portage.subprocess_getstatusoutput("id -G %s" % _portage_uname)
+                       if mystatus == os.EX_OK:
+                               for x in myoutput.split():
+                                       try:
+                                               v.append(int(x))
+                                       except ValueError:
+                                               pass
+                               v = sorted(set(v))
+       elif k == '_portage_grpname':
+               env = getattr(portage, 'settings', os.environ)
 -              v = env.get('PORTAGE_GRPNAME', 'portage')
++              # PREFIX LOCAL: use var iso hardwired 'portage'
++              v = env.get('PORTAGE_GRPNAME', PORTAGE_GROUPNAME)
++              # END PREFIX LOCAL
+       elif k == '_portage_uname':
 -              env = getattr(portage, 'settings', os.environ)
++              # PREFIX LOCAL: use var iso hardwired 'portage'
++              env = getattr(portage, 'settings', PORTAGE_USERNAME)
++              # END PREFIX LOCAL
+               v = env.get('PORTAGE_USERNAME', 'portage')
        else:
-               portage_gid = None
- try:
-       portage_uid = pwd.getpwnam(_portage_uname)[2]
- except KeyError:
-       portage_uid = None
- if portage_uid is None or portage_gid is None:
-       portage_uid=0
-       portage_gid=0
-       userpriv_groups = [portage_gid]
-       writemsg(colorize("BAD",
-               "portage: "+_portage_uname+" user or "+_portage_grpname+" group missing.") + "\n", noiselevel=-1)
-       writemsg(colorize("BAD",
-               "         In Prefix Portage this is quite dramatic") + "\n", noiselevel=-1)
-       writemsg(colorize("BAD",
-               "         since it means you have thrown away yourself.") + "\n", noiselevel=-1)
-       writemsg(colorize("BAD",
-               "         Re-add yourself or re-bootstrap Gentoo Prefix.") + "\n", noiselevel=-1)
- # we need to fix this one day to distinguish prefix vs non-prefix
- #             _("portage: 'portage' user or group missing.")) + "\n", noiselevel=-1)
- #     writemsg(_(
- #             "         For the defaults, line 1 goes into passwd, "
- #             "and 2 into group.\n"), noiselevel=-1)
- #     writemsg(colorize("GOOD",
- #             "         portage:x:250:250:portage:/var/tmp/portage:/bin/false") \
- #             + "\n", noiselevel=-1)
- #     writemsg(colorize("GOOD", "         portage::250:portage") + "\n",
- #             noiselevel=-1)
-       portage_group_warning()
- else:
-       if secpass < 1 and portage_gid in os.getgroups():
-               secpass=1
-       userpriv_groups = [portage_gid]
-       if secpass >= 2:
-               class _LazyUserprivGroups(portage.proxy.objectproxy.ObjectProxy):
-                       def _get_target(self):
-                               global userpriv_groups
-                               if userpriv_groups is not self:
-                                       return userpriv_groups
-                               userpriv_groups = _userpriv_groups
-                               # Get a list of group IDs for the portage user. Do not use
-                               # grp.getgrall() since it is known to trigger spurious
-                               # SIGPIPE problems with nss_ldap.
-                               mystatus, myoutput = \
-                                       portage.subprocess_getstatusoutput("id -G %s" % _portage_uname)
-                               if mystatus == os.EX_OK:
-                                       for x in myoutput.split():
-                                               try:
-                                                       userpriv_groups.append(int(x))
-                                               except ValueError:
-                                                       pass
-                                       userpriv_groups[:] = sorted(set(userpriv_groups))
-                               return userpriv_groups
-               _userpriv_groups = userpriv_groups
-               userpriv_groups = _LazyUserprivGroups()
+               raise AssertionError('unknown name: %s' % k)
+       globals()[k] = v
+       _initialized_globals.add(k)
+       return v
+ class _GlobalProxy(portage.proxy.objectproxy.ObjectProxy):
+       __slots__ = ('_name',)
+       def __init__(self, name):
+               portage.proxy.objectproxy.ObjectProxy.__init__(self)
+               object.__setattr__(self, '_name', name)
+       def _get_target(self):
+               return _get_global(object.__getattribute__(self, '_name'))
+ for k in ('portage_gid', 'portage_uid', 'secpass', 'userpriv_groups',
+       '_portage_grpname', '_portage_uname'):
+       globals()[k] = _GlobalProxy(k)
+ del k
+ def _init(settings):
+       """
+       Use config variables like PORTAGE_GRPNAME and PORTAGE_USERNAME to
+       initialize global variables. This allows settings to come from make.conf
+       instead of requiring them to be set in the calling environment.
+       """
+       if '_portage_grpname' not in _initialized_globals:
+               v = settings.get('PORTAGE_GRPNAME')
+               if v is not None:
+                       globals()['_portage_grpname'] = v
+                       _initialized_globals.add('_portage_grpname')
+       if '_portage_uname' not in _initialized_globals:
+               v = settings.get('PORTAGE_USERNAME')
+               if v is not None:
+                       globals()['_portage_uname'] = v
+                       _initialized_globals.add('_portage_uname')
index d35be0a7ab8cd9509ac7f7b580398c2a5f3296c1,abd3ac1416d920ff1b642c8f6dd62ce44ff64476..bfd6517b29a7bd871ba9cdd16668e5f6069a149b
@@@ -13,7 -13,7 +13,8 @@@ import os, sys, shuti
  import portage
  from portage.env.loaders import KeyValuePairFileLoader
  from portage.localization import _
+ from portage.util import varexpand
 +from portage.const import EPREFIX
  
  RCS_BRANCH = '1.1.1'
  RCS_LOCK = 'rcs -ko -M -l'
@@@ -39,11 -39,12 +40,12 @@@ def diffstatusoutput_len(cmd)
          return (1, 1)
  
  def read_config(mandatory_opts):
-     loader = KeyValuePairFileLoader(
-         EPREFIX + '/etc/dispatch-conf.conf', None)
 -    eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX", "/")
++    eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX", EPREFIX)
+     config_path = os.path.join(eprefix, "etc/dispatch-conf.conf")
+     loader = KeyValuePairFileLoader(config_path, None)
      opts, errors = loader.load()
      if not opts:
-         print(_('dispatch-conf: Error reading %s/etc/dispatch-conf.conf; fatal') % (EPREFIX,), file=sys.stderr)
 -        print(_('dispatch-conf: Error reading /etc/dispatch-conf.conf; fatal'), file=sys.stderr)
++        print(_('dispatch-conf: Error reading %s/etc/dispatch-conf.conf; fatal') % (eprefix,), file=sys.stderr)
          sys.exit(1)
  
        # Handle quote removal here, since KeyValuePairFileLoader doesn't do that.
index b729c6a638f160bf95135f3d1d5e898669747356,9ac37fb8514054520e577fd022172b7f35ee4e6e..d07f68b35e11eefe1dbc87bcd0e78eff95ea0aa9
@@@ -66,9 -66,7 +66,9 @@@ environ_whitelist += 
        "REPLACING_VERSIONS", "REPLACED_BY_VERSION",
        "ROOT", "ROOTPATH", "T", "TMP", "TMPDIR",
        "USE_EXPAND", "USE_ORDER", "WORKDIR",
-       "XARGS",
+       "XARGS", "__PORTAGE_TEST_EPREFIX",
 +      "BPREFIX", "DEFAULT_PATH", "EXTRA_PATH",
 +      "PORTAGE_GROUP", "PORTAGE_USER",
  ]
  
  # user config variables
Simple merge