# 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
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)
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)
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 = []
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":