From: Fabian Groffen Date: Mon, 6 Jun 2011 17:11:14 +0000 (+0200) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=09b931e2e6f99898a0381a04543344b28213833f;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: pym/_emerge/emergelog.py --- 09b931e2e6f99898a0381a04543344b28213833f diff --cc bin/etc-update index 205438943,42518adc6..09362952c --- a/bin/etc-update +++ b/bin/etc-update @@@ -549,18 -548,14 +549,19 @@@ 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 -chown ${UID:-0}:${GID:-0} "${TMP}" || die "failed to set ownership 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 # 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) EU_AUTOMERGE=$(get_config eu_automerge) rm_opts=$(get_config rm_opts) mv_opts=$(get_config mv_opts) diff --cc bin/portageq index 5f0e69853,fa713889a..800b444be --- a/bin/portageq +++ b/bin/portageq @@@ -21,16 -21,11 +21,15 @@@ except KeyboardInterrupt sys.exit(128 + signal.SIGINT) import os - import subprocess import types +# for an explanation on this logic, see pym/_emerge/__init__.py +if os.environ.__contains__("PORTAGE_PYTHONPATH"): + pym_path = os.environ["PORTAGE_PYTHONPATH"] +else: + pym_path = os.path.join(os.path.dirname( + os.path.dirname(os.path.realpath(__file__))), "pym") # Avoid sandbox violations after python upgrade. -pym_path = os.path.join(os.path.dirname( - os.path.dirname(os.path.realpath(__file__))), "pym") if os.environ.get("SANDBOX_ON") == "1": sandbox_write = os.environ.get("SANDBOX_WRITE", "").split(":") if pym_path not in sandbox_write: diff --cc pym/_emerge/emergelog.py index 046c99b9a,9cac3b222..20cec9fb8 --- a/pym/_emerge/emergelog.py +++ b/pym/_emerge/emergelog.py @@@ -12,10 -12,12 +12,13 @@@ from portage import _encoding from portage import _unicode_encode from portage.data import secpass from portage.output import xtermTitle +from portage.const import EPREFIX + # We disable emergelog by default, since it's called from + # dblink.merge() and we don't want that to trigger log writes + # unless it's really called via emerge. + _disable = True -_emerge_log_dir = '/var/log' +_emerge_log_dir = EPREFIX + '/var/log' - _disable = False def emergelog(xterm_titles, mystr, short_msg=None): diff --cc pym/portage/_sets/files.py index f422ed9cc,f19ecf6ce..7992b82d0 --- a/pym/portage/_sets/files.py +++ b/pym/portage/_sets/files.py @@@ -1,6 -1,7 +1,6 @@@ - # Copyright 2007 Gentoo Foundation + # Copyright 2007-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -import errno import re from itertools import chain