commit: 00ef5c3294e8b7530aa8881649c5bc21b7def377 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Mon Jan 21 23:34:32 2013 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Sat Jun 14 05:18:53 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=00ef5c32
fix options being reset by a config file --- catalyst/main.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 776a678..1446cf9 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -204,9 +204,7 @@ def main(): usage() sys.exit(2) - # initialize it if it's not already - if 'options' not in conf_values: - conf_values['options'] = set() + options = set() run = False for o, a in opts: @@ -237,7 +235,7 @@ def main(): myspecfile=a if o in ("-F", "--fetchonly"): - conf_values['options'].add("fetch") + options.add("fetch") if o in ("-v", "--verbose"): conf_values["VERBOSE"]="1" @@ -253,16 +251,18 @@ def main(): mycmdline.append("version_stamp="+a) if o in ("-p", "--purge"): - conf_values['options'].add("purge") + options.add("purge") if o in ("-P", "--purgeonly"): - conf_values['options'].add("purgeonly") + options.add("purgeonly") if o in ("-T", "--purgetmponly"): - conf_values['options'].add("purgetmponly") + options.add("purgetmponly") if o in ("-a", "--clear-autoresume"): - conf_values['options'].add("clear-autoresume") + options.add("clear-autoresume") + + #print "MAIN: cli options =", options if not run: print "!!! catalyst: please specify one of either -f or -C\n" @@ -272,6 +272,9 @@ def main(): # import configuration file and import our main module using those settings parse_config(myconfig) + conf_values["options"].update(options) + #print "MAIN: conf_values['options'] =", conf_values["options"] + # initialize our contents generator contents_map = ContentsMap(CONTENTS_DEFINITIONS) conf_values["contents_map"] = contents_map