Fix etc-update and config-protect.
authorFabian Groffen <grobian@gentoo.org>
Sun, 15 Oct 2006 18:40:08 +0000 (18:40 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 15 Oct 2006 18:40:08 +0000 (18:40 -0000)
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
bin/etc-update
cnf/make.globals
pym/portage.py

index 2c4c3900285260f221e4496ae9003205cbde2e3b..03bd2a790a90550a25887202e385f1bd4ab88412 100755 (executable)
@@ -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)
 
index 166a5f1083639ecd022af6e09c3721d7608141ef..7258467f12ef708802c481dbc9aad55bc699313d 100755 (executable)
@@ -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
index b4b0605f30372632e3b3a573a0b2424aba7f85f1..6fc397d7af7cb3bc7d9dac2cbaad86c6405a112a 100644 (file)
@@ -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"
index e9a7506b7cf8abc93f5a4965c77d2f3c73567598..0c076f26ea05878bdc30171ab1c2266f20daf013 100644 (file)
@@ -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