From: Fabian Groffen Date: Sat, 31 Mar 2012 19:30:59 +0000 (+0200) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1fac28c57317b8174580b8243c3549fd75aeaa6d;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/ebuild-helpers/dosym bin/ebuild-helpers/fowners bin/etc-update bin/repoman pym/_emerge/main.py --- 1fac28c57317b8174580b8243c3549fd75aeaa6d diff --cc bin/dispatch-conf index 1b86461c9,139a001e8..de8d85db7 --- a/bin/dispatch-conf +++ b/bin/dispatch-conf @@@ -33,9 -27,8 +33,9 @@@ import portag from portage import os from portage import dispatch_conf from portage import _unicode_decode - from portage.dispatch_conf import diffstatusoutput_len + from portage.dispatch_conf import diffstatusoutput from portage.process import find_binary +from portage.const import EPREFIX FIND_EXTANT_CONFIGS = "find '%s' %s -name '._cfg????_%s' ! -name '.*~' ! -iname '.*.bak' -print" DIFF_CONTENTS = "diff -Nu '%s' '%s'" diff --cc bin/ebuild-helpers/dosym index 8f436fa95,2489e22a2..b96f84521 --- a/bin/ebuild-helpers/dosym +++ b/bin/ebuild-helpers/dosym @@@ -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:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh if [[ $# -ne 2 ]] ; then helpers_die "${0##*/}: two arguments needed" diff --cc bin/ebuild-helpers/fowners index 9815d2ea6,a213c9eb1..b60aad7c1 --- a/bin/ebuild-helpers/fowners +++ b/bin/ebuild-helpers/fowners @@@ -1,18 -1,11 +1,12 @@@ -#!/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:-/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 - # END PREFIX LOCAL [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + case "$EAPI" in 0|1|2) EPREFIX= ED=${D} ;; esac # we can't prefix all arguments because # chown takes random options diff --cc bin/emerge-webrsync index c41eb7935,bfd9aa2fc..581dc5490 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@@ -31,11 -39,10 +39,11 @@@ els eecho "could not find 'portageq'; aborting" exit 1 fi - eval $(portageq envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \ + eval $("${portageq}" envvar -v FEATURES FETCHCOMMAND GENTOO_MIRRORS \ PORTAGE_BIN_PATH PORTAGE_GPG_DIR \ PORTAGE_NICENESS PORTAGE_RSYNC_EXTRA_OPTS PORTAGE_TMPDIR PORTDIR \ - SYNC http_proxy ftp_proxy) + SYNC http_proxy ftp_proxy \ + EPREFIX PORTAGE_USER PORTAGE_GROUP) DISTDIR="${PORTAGE_TMPDIR}/emerge-webrsync" export http_proxy ftp_proxy diff --cc bin/etc-update index b3877fbea,1edc91fab..2a24613e4 --- a/bin/etc-update +++ b/bin/etc-update @@@ -1,5 -1,5 +1,5 @@@ -#!/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 # Author Brandon Low diff --cc bin/misc-functions.sh index 406cd8f82,b08389714..0d60a51e7 mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh diff --cc bin/repoman index 1f51ddf87,54d864f15..b89e5efbf --- a/bin/repoman +++ b/bin/repoman @@@ -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 # Next to do: dep syntax checking in mask files diff --cc pym/_emerge/actions.py index 15a0bc1ac,22c3e265f..cbc5de2bd --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@@ -25,12 -25,12 +25,12 @@@ portage.proxy.lazyimport.lazyimport(glo 'portage.news:count_unread_news,display_news_notifications', ) + from portage.localization import _ from portage import os from portage import shutil - from portage import subprocess_getstatusoutput from portage import _unicode_decode from portage.cache.cache_errors import CacheError -from portage.const import GLOBAL_CONFIG_PATH +from portage.const import GLOBAL_CONFIG_PATH, EPREFIX from portage.const import _ENABLE_DYN_LINK_MAP, _ENABLE_SET_CONFIG from portage.dbapi.dep_expand import dep_expand from portage.dbapi._expand_new_virt import expand_new_virt diff --cc pym/_emerge/main.py index 3d50b7d87,0fbc4b7f7..68e951d4f --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@@ -180,11 -180,21 +181,11 @@@ def chk_updated_info_files(root, infodi raise del e processed_count += 1 - try: - proc = subprocess.Popen( - ['/usr/bin/install-info', - '--dir-file=%s' % os.path.join(inforoot, "dir"), - os.path.join(inforoot, x)], - env=dict(os.environ, LANG="C", LANGUAGE="C"), - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - except OSError: - myso = None - else: - myso = _unicode_decode( - proc.communicate()[0]).rstrip("\n") - proc.wait() + myso = portage.subprocess_getstatusoutput( + "LANG=C LANGUAGE=C %s/usr/bin/install-info " \ + "--dir-file=%s/dir %s/%s" % (EPREFIX, inforoot, inforoot, x))[1] existsstr="already exists, for file `" - if myso!="": + if myso: if re.search(existsstr,myso): # Already exists... Don't increment the count for this. pass diff --cc pym/portage/dispatch_conf.py index 88ed222dd,cc98fad16..2fa1357f5 --- a/pym/portage/dispatch_conf.py +++ b/pym/portage/dispatch_conf.py @@@ -24,23 -23,23 +24,23 @@@ RCS_MERGE = "rcsmerge -p -r" + RCS_BRAN DIFF3_MERGE = "diff3 -mE '%s' '%s' '%s' > '%s'" - def diffstatusoutput_len(cmd): + def diffstatusoutput(cmd, file1, file2): """ Execute the string cmd in a shell with getstatusoutput() and return a - 2-tuple (status, output_length). If getstatusoutput() raises - UnicodeDecodeError (known to happen with python3.1), return a - 2-tuple (1, 1). This provides a simple way to check for non-zero - output length of diff commands, while providing simple handling of - UnicodeDecodeError when necessary. + 2-tuple (status, output). """ - try: - status, output = portage.subprocess_getstatusoutput(cmd) - return (status, len(output)) - except UnicodeDecodeError: - return (1, 1) + # Use Popen to emulate getstatusoutput(), since getstatusoutput() may + # raise a UnicodeDecodeError which makes the output inaccessible. + proc = subprocess.Popen(portage._unicode_encode(cmd % (file1, file2)), + stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) + output = portage._unicode_decode(proc.communicate()[0]) + if output and output[-1] == "\n": + # getstatusoutput strips one newline + output = output[:-1] + return (proc.wait(), output) def read_config(mandatory_opts): - eprefix = portage.const.EPREFIX + eprefix = EPREFIX config_path = os.path.join(eprefix or os.sep, "etc/dispatch-conf.conf") loader = KeyValuePairFileLoader(config_path, None) opts, errors = loader.load()