commit:     d80b3f11733e63db412c04d54abe4c3fb18760d1
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 23 00:46:25 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Mar 29 22:46:20 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d80b3f11

WIP: repository config changes for plugin-syc

---
 pym/portage/repository/config.py  | 21 +--------------------
 pym/portage/sync/config_checks.py | 26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 8085d3f..da9b2fc 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -31,6 +31,7 @@ from portage import _unicode_decode
 from portage import _unicode_encode
 from portage import _encodings
 from portage import manifest
+import portage.sync
 
 if sys.hexversion >= 0x3000000:
        basestring = str
@@ -555,26 +556,6 @@ class RepoConfigLoader(object):
 
                        repo = RepoConfig(sname, optdict, 
local_config=local_config)
 
-                       if repo.sync_type is not None and repo.sync_uri is None:
-                               writemsg_level("!!! %s\n" % _("Repository '%s' 
has sync-type attribute, but is missing sync-uri attribute") %
-                                       sname, level=logging.ERROR, 
noiselevel=-1)
-                               continue
-
-                       if repo.sync_uri is not None and repo.sync_type is None:
-                               writemsg_level("!!! %s\n" % _("Repository '%s' 
has sync-uri attribute, but is missing sync-type attribute") %
-                                       sname, level=logging.ERROR, 
noiselevel=-1)
-                               continue
-
-                       if repo.sync_type not in portage.sync.module_names + 
[None]:
-                               writemsg_level("!!! %s\n" % _("Repository '%s' 
has sync-type attribute set to unsupported value: '%s'") %
-                                       (sname, repo.sync_type), 
level=logging.ERROR, noiselevel=-1)
-                               continue
-
-                       if repo.sync_type == "cvs" and repo.sync_cvs_repo is 
None:
-                               writemsg_level("!!! %s\n" % _("Repository '%s' 
has sync-type=cvs, but is missing sync-cvs-repo attribute") %
-                                       sname, level=logging.ERROR, 
noiselevel=-1)
-                               continue
-
                        # For backward compatibility with locations set via 
PORTDIR and
                        # PORTDIR_OVERLAY, delay validation of the location and 
repo.name
                        # until after PORTDIR and PORTDIR_OVERLAY have been 
processed.

diff --git a/pym/portage/sync/config_checks.py 
b/pym/portage/sync/config_checks.py
new file mode 100644
index 0000000..8180d90
--- /dev/null
+++ b/pym/portage/sync/config_checks.py
@@ -0,0 +1,26 @@
+
+
+
+class CheckSyncEntries(object):
+
+       def check_repo(repo):
+               if repo.sync_type is not None and repo.sync_uri is None:
+                       writemsg_level("!!! %s\n" % _("Repository '%s' has 
sync-type attribute, but is missing sync-uri attribute") %
+                               sname, level=logging.ERROR, noiselevel=-1)
+                       continue
+
+               if repo.sync_uri is not None and repo.sync_type is None:
+                       writemsg_level("!!! %s\n" % _("Repository '%s' has 
sync-uri attribute, but is missing sync-type attribute") %
+                               sname, level=logging.ERROR, noiselevel=-1)
+                       continue
+
+               if repo.sync_type not in portage.sync.module_names + [None]:
+                       writemsg_level("!!! %s\n" % _("Repository '%s' has 
sync-type attribute set to unsupported value: '%s'") %
+                               (sname, repo.sync_type), level=logging.ERROR, 
noiselevel=-1)
+                       continue
+
+               if repo.sync_type == "cvs" and repo.sync_cvs_repo is None:
+                       writemsg_level("!!! %s\n" % _("Repository '%s' has 
sync-type=cvs, but is missing sync-cvs-repo attribute") %
+                               sname, level=logging.ERROR, noiselevel=-1)
+                       continue
+

Reply via email to