Merged from trunk 6209:6217
authorFabian Groffen <grobian@gentoo.org>
Sat, 17 Mar 2007 14:22:40 +0000 (14:22 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 17 Mar 2007 14:22:40 +0000 (14:22 -0000)
Automatically convert ROOT and PORTAGE_CONFIGROOT to absolute paths when
necessary since relative paths lead to problems.  Thanks to Christian
Heim <phreak@gentoo.org> for reporting.

Add back rstrip(os.path.sep) from the previous commit since it's needed
when ROOT="/".

For bug #163262 and conformance with section 7.2 of the PMS, make the
export attribute of variables persist between ebuild phases.

For bug #171117, ensure that the new and old config have different
timestamps (for the benefit of programs like rsync that need
distiguishable timestamps to detect file changes).  Thanks to Ben
Bennett <sink@limey.net> for reporting.

Fix a utime call to prevent a timestamp collision for bug #171117.

svn path=/main/branches/prefix/; revision=6235

bin/ebuild.sh
pym/portage/__init__.py
pym/portage/dbapi/vartree.py

index 620e47e0490174b2d189c466bdf23a4502e7a029..5f4b1777b983a51afdcc392056214c768c2cde9f 100755 (executable)
@@ -1773,6 +1773,7 @@ if [ -n "${myarg}" ] && \
        # Save current environment and touch a success file. (echo for success)
        umask 002
        set | @EGREP@ -v "^SANDBOX_" > "${T}/environment" 2>/dev/null
+       export | @EGREP@ -v "^declare -x SANDBOX_" >> "${T}/environment" 2>/dev/null
        chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/environment" &>/dev/null
        chmod g+w "${T}/environment" &>/dev/null
 fi
index c7affe743499dfc3032f630c61b937c621e9db1f..4b5f7d8198f2d9dac661151fc4cefc2539250eda 100644 (file)
@@ -927,8 +927,8 @@ class config:
                        if config_root is None:
                                config_root = "/"
 
-                       config_root = \
-                               normalize_path(config_root).rstrip(os.path.sep) + os.path.sep
+                       config_root = normalize_path(os.path.abspath(
+                               config_root)).rstrip(os.path.sep) + os.path.sep
 
                        check_var_directory("PORTAGE_CONFIGROOT", config_root + EPREFIX)
 
@@ -1179,8 +1179,8 @@ class config:
                        if target_root is None:
                                target_root = "/"
 
-                       target_root = \
-                               normalize_path(target_root).rstrip(os.path.sep) + os.path.sep
+                       target_root = normalize_path(os.path.abspath(
+                               target_root)).rstrip(os.path.sep) + os.path.sep
 
                        check_var_directory("ROOT", target_root + EPREFIX)
 
index e28938027ffee58cfa6843c7183c5042115a82cc..e37f1e6a4a8e69cfa90072cbedb77eacad65634a 100644 (file)
@@ -1494,8 +1494,14 @@ class dblink(object):
                else:
                        cfgfiledict["IGNORE"]=0
 
+               # Timestamp for files being merged.  Use time() - 1 in order to prevent
+               # a collision with timestamps that are bumped by the utime() call
+               # inside isprotected().  This ensures that the new and old config have
+               # different timestamps (for the benefit of programs like rsync that
+               # that need distiguishable timestamps to detect file changes).
+               mymtime = long(time.time() - 1)
+
                # set umask to 0 for merging; back up umask, save old one in prevmask (since this is a global change)
-               mymtime = long(time.time())
                prevmask = os.umask(0)
                secondhand = []
 
@@ -1838,10 +1844,10 @@ class dblink(object):
                                                sys.exit(1)
                                        zing = ">>>"
                                else:
-                                       mymtime = thismtime
+                                       mymtime = long(time.time())
                                        # We need to touch the destination so that on --update the
                                        # old package won't yank the file with it. (non-cfgprot related)
-                                       os.utime(mydest, (thismtime,thismtime))
+                                       os.utime(mydest, (mymtime, mymtime))
                                        zing = "---"
                                if self.settings["USERLAND"] == "Darwin" and myrealdest[-2:] == ".a":