summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/actions.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index a62b30510..87610a693 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -1971,6 +1971,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
os.umask(0o022)
dosyncuri = syncuri
updatecache_flg = False
+ git = False
if myaction == "metadata":
print("skipping sync")
updatecache_flg = True
@@ -1999,9 +2000,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
msg = ">>> Git pull in %s successful" % myportdir
emergelog(xterm_titles, msg)
writemsg_level(msg + "\n")
- exitcode = git_sync_timestamps(portdb, myportdir)
- if exitcode == os.EX_OK:
- updatecache_flg = True
+ git = True
elif syncuri[:8]=="rsync://" or syncuri[:6]=="ssh://":
for vcs_dir in vcs_dirs:
writemsg_level(("!!! %s appears to be under revision " + \
@@ -2443,17 +2442,25 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
noiselevel=-1, level=logging.ERROR)
return 1
- if updatecache_flg and \
- myaction != "metadata" and \
- "metadata-transfer" not in settings.features:
- updatecache_flg = False
-
# Reload the whole config from scratch.
settings, trees, mtimedb = load_emerge_config(trees=trees)
adjust_configs(myopts, trees)
root_config = trees[settings['EROOT']]['root_config']
portdb = trees[settings['EROOT']]['porttree'].dbapi
+ if git:
+ # NOTE: Do this after reloading the config, in case
+ # it did not exist prior to sync, so that the config
+ # and portdb properly account for its existence.
+ exitcode = git_sync_timestamps(portdb, myportdir)
+ if exitcode == os.EX_OK:
+ updatecache_flg = True
+
+ if updatecache_flg and \
+ myaction != "metadata" and \
+ "metadata-transfer" not in settings.features:
+ updatecache_flg = False
+
if updatecache_flg and \
os.path.exists(os.path.join(myportdir, 'metadata', 'cache')):