commit: 13380e488ad4a458d7d2410bc235c62d61c7a595
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 8 01:55:58 2015 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Feb 8 01:55:58 2015 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=13380e48
updater.py: Add a -R, --rebuild option to force a rebuild of the config
---
layman/updater.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/layman/updater.py b/layman/updater.py
index e3003f9..fe3f300 100644
--- a/layman/updater.py
+++ b/layman/updater.py
@@ -57,6 +57,8 @@ class Main(object):
help = 'Print the NEW INSTALL help messages.')
self.parser.add_argument("-c", "--config",
help='the path to config file')
+ self.parser.add_argument("-R", "--rebuild", action='store_true',
+ help='rebuild the Pacakge Manager config file')
self.parser.add_argument('--version', action='version',
version='%(prog)s ' + VERSION)
@@ -85,18 +87,18 @@ class Main(object):
if self.args.setup_help:
self.print_instructions()
- elif not self.check_is_new():
+ elif not self.check_is_new(self.args.rebuild):
self.rename_check()
- def check_is_new(self):
+ def check_is_new(self, rebuild=False):
print_instructions = False
if isinstance(self.config['conf_type'], STR):
self.config.set_option('conf_type',
self.config['conf_type'].split(','))
for i in self.config['conf_type']:
conf = i.replace('.', '_').strip()
- if conf and not os.access(self.config[conf], os.F_OK):
+ if conf and (rebuild or not os.access(self.config[conf], os.F_OK)):
getattr(self, 'create_%(conf)s' % {'conf': conf})()
print_instructions = True
if print_instructions: