commit:     b00db4058fd0633378dc7082faf08a5ac0de013e
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 17 21:16:27 2014 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 17 21:16:27 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=b00db405

reposconf.py: Modifies options added if sync_type doesn't exist

To prevent future complaining from portage, the options added to the
repos.conf has been changed if the sync_type does not exist.

---
 layman/config_modules/reposconf/reposconf.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/layman/config_modules/reposconf/reposconf.py 
b/layman/config_modules/reposconf/reposconf.py
index b664276..344c779 100644
--- a/layman/config_modules/reposconf/reposconf.py
+++ b/layman/config_modules/reposconf/reposconf.py
@@ -30,7 +30,7 @@ try:
     from portage.sync.modules import layman_
     sync_type = "layman"
 except ImportError:
-    sync_type = "None"
+    sync_type = None
 
 from   layman.compatibility  import fileopen
 from   layman.utils          import path
@@ -89,9 +89,10 @@ class ConfigHandler:
         self.repo_conf.add_section(overlay.name)
         self.repo_conf.set(overlay.name, 'priority', str(overlay.priority))
         self.repo_conf.set(overlay.name, 'location', path((self.storage, 
overlay.name)))
-        self.repo_conf.set(overlay.name, 'sync-type', sync_type)
         self.repo_conf.set(overlay.name, 'layman-type', 
overlay.sources[0].type_key)
-        self.repo_conf.set(overlay.name, 'sync-uri', overlay.sources[0].src)
+        if sync_type:
+            self.repo_conf.set(overlay.name, 'sync-type', sync_type)
+            self.repo_conf.set(overlay.name, 'sync-uri', 
overlay.sources[0].src)
         if overlay.sources[0].branch:
             self.repo_conf.set(overlay.name, 'branch', 
overlay.sources[0].branch)
         self.repo_conf.set(overlay.name, 'auto-sync', self.config['auto_sync'])

Reply via email to