From 145d8e30eb6ad2db635a5ccf2c9e63187cb132ab Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Sun, 15 Oct 2006 18:40:08 +0000 Subject: [PATCH] Fix etc-update and config-protect. Because the profiles contain CONFIG_PROTECT variables, they cannot be prefixed without defining variables there. Hacking portage to only prefix those paths from the profiles is a bit ugly (and hard), so instead it was decided (like Kito already decided once long ago) that CONFIG_PROTECT paths are non-prefixed, as the only exception in the system. This means that no corrections need to be done, and that when the paths are being used they have to be prefixed. svn path=/main/branches/prefix/; revision=4717 --- bin/emerge | 9 +++++++-- bin/etc-update | 7 +++++-- cnf/make.globals | 2 +- pym/portage.py | 3 +-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/bin/emerge b/bin/emerge index 2c4c39002..03bd2a790 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2767,10 +2767,15 @@ def post_emerge(settings, mtimedb, retval): emergelog("notitles" not in settings.features, " *** exiting successfully.") + from portage_util import normalize_path if "noinfo" not in settings.features: - chk_updated_info_files(target_root, infodirs, info_mtimes, retval) + chk_updated_info_files( + normalize_path(target_root + portage_const.EPREFIX), + infodirs, info_mtimes, retval) - chk_updated_cfg_files(target_root, config_protect) + chk_updated_cfg_files( + normalize_path(target_root + portage_const.EPREFIX), + config_protect) mtimedb.commit() sys.exit(retval) diff --git a/bin/etc-update b/bin/etc-update index 166a5f108..7258467f1 100755 --- a/bin/etc-update +++ b/bin/etc-update @@ -43,7 +43,7 @@ function scan() { fi for path in ${CONFIG_PROTECT} ; do - path="${ROOT}${path}" + path="${ROOT}${EPREFIX}/${path}" find_opts="-iname ._cfg????_*" if [ ! -d "${path}" ]; then [ ! -f "${path}" ] && continue @@ -438,9 +438,12 @@ trap die term eval $(@PORTAGE_BASE@/bin/portageq envvar -v CONFIG_PROTECT \ - CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT) + CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT EPREFIX) export PORTAGE_TMPDIR +# quick hack to get prefix support in +PORTAGE_CONFIGROOT=${PORTAGE_CONFIGROOT}${EPREFIX}/ + [ -w ${PORTAGE_CONFIGROOT}etc ] || die "Need write access to ${PORTAGE_CONFIGROOT}etc" 1 #echo $PORTAGE_TMPDIR #echo $CONFIG_PROTECT diff --git a/cnf/make.globals b/cnf/make.globals index b4b0605f3..6fc397d7a 100644 --- a/cnf/make.globals +++ b/cnf/make.globals @@ -57,7 +57,7 @@ PORTAGE_RSYNC_RETRIES="3" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" # Minimal CONFIG_PROTECT -CONFIG_PROTECT="@DOMAIN_PREFIX@/etc" +CONFIG_PROTECT="/etc" # Disable auto-use USE_ORDER="env:pkg:conf:pkgprofile:defaults:pkginternal" diff --git a/pym/portage.py b/pym/portage.py index e9a7506b7..0c076f26e 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -5729,8 +5729,7 @@ class dblink: raise ValueError self.myroot=myroot - protect_obj = portage_util.ConfigProtect(myroot - + portage_const.EPREFIX, + protect_obj = portage_util.ConfigProtect(myroot + portage_const.EPREFIX, mysettings.get("CONFIG_PROTECT","").split(), mysettings.get("CONFIG_PROTECT_MASK","").split()) self.updateprotect = protect_obj.updateprotect -- 2.26.2