RepoConfig: backward compat SYNC for mirrorselect
authorZac Medico <zmedico@gentoo.org>
Thu, 25 Jul 2013 19:54:49 +0000 (12:54 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 25 Jul 2013 19:54:49 +0000 (12:54 -0700)
This restores SYNC support which was removed in commit
47e8d22dabf2197193c8f133698fb967afa560f4.

pym/portage/repository/config.py

index 919a9d67b85bf7171025b4be87e5bb55687c01e6..57cc3a3c954d2a5b19f6be151a5440c643b296c4 100644 (file)
@@ -575,9 +575,11 @@ class RepoConfigLoader(object):
                if "PORTAGE_REPOSITORIES" in settings:
                        portdir = ""
                        portdir_overlay = ""
+                       portdir_sync = ""
                else:
                        portdir = settings.get("PORTDIR", "")
                        portdir_overlay = settings.get("PORTDIR_OVERLAY", "")
+                       portdir_sync = settings.get("SYNC", "")
 
                try:
                        self._parse(paths, prepos, ignored_map,
@@ -697,6 +699,12 @@ class RepoConfigLoader(object):
                        # This happens if main-repo has been set in repos.conf.
                        prepos[main_repo].priority = -1000
 
+               # Backward compatible SYNC support for mirrorselect.
+               if portdir_sync and main_repo is not None:
+                       if portdir_sync.startswith("rsync://"):
+                               prepos[main_repo].sync_uri = portdir_sync
+                               prepos[main_repo].sync_type = "rsync"
+
                # Include repo.name in sort key, for predictable sorting
                # even when priorities are equal.
                prepos_order = sorted(prepos.items(),