diff --git a/main/tags/2.2_rc23/pym/_emerge/__init__.py b/main/tags/2.2_rc23/pym/_emerge/__init__.py index 9ff154f..920abb0 100644 --- a/main/tags/2.2_rc23/pym/_emerge/__init__.py +++ b/main/tags/2.2_rc23/pym/_emerge/__init__.py @@ -12033,8 +12033,14 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): out = portage.output.EOutput() myportdir = settings.get("PORTDIR", None) + sync_method = settings.get("SYNC_METHOD", "").strip() syncuri = settings.get("SYNC", "").strip() + if not sync_method: + writemsg_level("!!! SYNC_METHOD is undefined. Is /etc/make.globals missing?\n", + noiselevel=-1, level=logging.ERROR) + return 1 + if not syncuri: writemsg_level("!!! SYNC is undefined. Is /etc/make.globals missing?\n", noiselevel=-1, level=logging.ERROR) @@ -12086,7 +12092,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): if myaction == "metadata": print "skipping sync" updatecache_flg = True - elif ".git" in vcs_dirs: + elif sync_method == "git": # Update existing git repository, and ignore the syncuri. We are # going to trust the user and assume that the user is in the branch # that he/she wants updated. We'll let the user manage branches with @@ -12114,7 +12120,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): exitcode = git_sync_timestamps(settings, myportdir) if exitcode == os.EX_OK: updatecache_flg = True - elif syncuri[:8]=="rsync://": + elif sync_method == "rsync": for vcs_dir in vcs_dirs: writemsg_level(("!!! %s appears to be under revision " + \ "control (contains %s).\n!!! Aborting rsync sync.\n") % \ @@ -12450,7 +12456,7 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): for line in msg: out.eerror(line) sys.exit(exitcode) - elif syncuri[:6]=="cvs://": + elif sync_method == "cvs": if not os.path.exists("/usr/bin/cvs"): print "!!! /usr/bin/cvs does not exist, so CVS support is disabled." print "!!! Type \"emerge dev-util/cvs\" to enable CVS support."