If a git repository is added in repos.conf that does not exist it will not be cloned. --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2165,10 +2165,6 @@ dosyncuri = syncuri updatecache_flg = False if repo.sync_type == "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 - # git directly. if portage.process.find_binary("git") is None: msg = ["Command not found: git", "Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM] @@ -2176,20 +2172,41 @@ writemsg_level("!!! %s\n" % l, level=logging.ERROR, noiselevel=-1) return 1 - msg = ">>> Starting git pull in %s..." % repo.location - emergelog(xterm_titles, msg ) - writemsg_level(msg + "\n") - exitcode = portage.process.spawn_bash("cd %s ; git pull" % \ - (portage._shell_quote(repo.location),), - **portage._native_kwargs(spawn_kwargs)) - if exitcode != os.EX_OK: - msg = "!!! git pull error in %s." % repo.location + if os.path.isdir(os.path.join(repo.location+'.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 + # git directly. + msg = ">>> Starting git pull in %s..." % repo.location + emergelog(xterm_titles, msg ) + writemsg_level(msg + "\n") + exitcode = portage.process.spawn_bash("cd %s ; git pull" % \ + (portage._shell_quote(repo.location),), + **portage._native_kwargs(spawn_kwargs)) + if exitcode != os.EX_OK: + msg = "!!! git pull error in %s." % repo.location + emergelog(xterm_titles, msg) + writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1) + return exitcode + msg = ">>> Git pull in %s successful" % repo.location emergelog(xterm_titles, msg) - writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1) - return exitcode - msg = ">>> Git pull in %s successful" % repo.location - emergelog(xterm_titles, msg) - writemsg_level(msg + "\n") + writemsg_level(msg + "\n") + else: + # Clone repository + msg = ">>> Starting git clone in %s..." % repo.location + emergelog(xterm_titles, msg ) + writemsg_level(msg + "\n") + exitcode = portage.process.spawn_bash("cd %s ; git clone %s ./" % \ + (portage._shell_quote(repo.location),portage._shell_quote(repo.sync_uri)), + **portage._native_kwargs(spawn_kwargs)) + if exitcode != os.EX_OK: + msg = "!!! git clone error in %s." % repo.location + emergelog(xterm_titles, msg) + writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1) + return exitcode + msg = ">>> Git clone in %s successful" % repo.location + emergelog(xterm_titles, msg) + writemsg_level(msg + "\n") elif repo.sync_type == "rsync": for vcs_dir in vcs_dirs: writemsg_level(("!!! %s appears to be under revision " + \ Reproducible: Always
Typo: s/repo.location+'.git'/repo.location, '.git'/
Thanks, but the sync system is nearing completion of a complete overhaul. Your patch for the old spaghetti code is not needed. The new sync code already handles new repo's. If you like, please test the plugin-sync branch of the portage git repo. It also adds a few variables to the repos.conf files. It also moves total control of sync operations from emerge to emaint, with "emerge --sync" providing auto-sync enabled repos to be synced only. Syncing of non auto-sync enabled repos must be done from "emaint sync" only. A new layman-sync plugin module is also being worked on and nearing completion in this years Layman gsoc project. Then layman overalys can be synced from emerge or emaint as well.
*** This bug has been marked as a duplicate of bug 485402 ***