aboutsummaryrefslogtreecommitdiff
path: root/layman
diff options
context:
space:
mode:
authorDevan Franchini <twitch153@gentoo.org>2016-04-30 18:08:12 -0400
committerDevan Franchini <twitch153@gentoo.org>2016-04-30 18:18:41 -0400
commit6f4d6dc0552b1bad10f8953de786cf0e78d975ee (patch)
treea74f0e2dda0276bf49cf99967d83c05e58c66058 /layman
parentlaymansync: Update module_spec for the change in portage's module.py (diff)
downloadlayman-6f4d6dc0552b1bad10f8953de786cf0e78d975ee.tar.gz
layman-6f4d6dc0552b1bad10f8953de786cf0e78d975ee.tar.bz2
layman-6f4d6dc0552b1bad10f8953de786cf0e78d975ee.zip
Repairs layman-updater rebuild functionality
reposconf.py: Adds rebuild __init__ parameter to fix rebuild functionality updater.py: Sets rebuild parameter for repos.conf ConfigHandler class
Diffstat (limited to 'layman')
-rw-r--r--layman/config_modules/reposconf/reposconf.py9
-rw-r--r--layman/updater.py2
2 files changed, 6 insertions, 5 deletions
diff --git a/layman/config_modules/reposconf/reposconf.py b/layman/config_modules/reposconf/reposconf.py
index 1f0fd04..79991c9 100644
--- a/layman/config_modules/reposconf/reposconf.py
+++ b/layman/config_modules/reposconf/reposconf.py
@@ -53,7 +53,7 @@ def check_conf_path(conf_path):
class ConfigHandler:
- def __init__(self, config, overlays):
+ def __init__(self, config, overlays, rebuild=False):
self.config = config
self.output = config['output']
@@ -61,7 +61,7 @@ class ConfigHandler:
self.path = check_conf_path(config['repos_conf'])
self.storage = config['storage']
self.repo_config = None
- self.rebuild = False
+ self.rebuild = rebuild
self.read()
@@ -193,14 +193,15 @@ class ConfigHandler:
if self.rebuild:
# start over with a fresh instance
self.repo_conf = ConfigParser.ConfigParser()
- if not self.repo_conf.sections():
+ for i in sorted(self.overlays):
+ self.add(self.overlays[i], no_write=True)
+ if not self.repo_conf.sections() and not self.rebuild:
if ('disable' in self.config.keys() and not
self.config['disable'][0].lower() == 'all'):
for i in sorted(self.overlays):
if not i == delete:
self.add(self.overlays[i], no_write=True)
self.repo_conf.write(laymanconf)
- self.rebuild = False
return True
except IOError as error:
self.output.error('ReposConf: ConfigHandler.write(); Failed to write "'\
diff --git a/layman/updater.py b/layman/updater.py
index 6384429..2bfc241 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -273,7 +273,7 @@ class Main(object):
# can write the overlays to it.
open(self.config['repos_conf'], 'w').close()
from layman.config_modules.reposconf.reposconf import ConfigHandler
- repos_conf = ConfigHandler(self.config, overlays)
+ repos_conf = ConfigHandler(self.config, overlays, rebuild=True)
repos_conf.write()