refactor to get better data into .treeinfo
for https://fedorahosted.org/rel-eng/ticket/6008 refacter how we deal with the data that feeds into .treeinfo Deprecate --name for --family Deprecate --flavor for --variant rather than using --name as the iso base name use the value of family if there is a variant add it with a - as the seperator
This commit is contained in:
parent
f116d9384f
commit
0633eb29d3
3 changed files with 38 additions and 29 deletions
|
|
@ -185,7 +185,7 @@ def main():
|
|||
# we already have all the content gathered
|
||||
mypungi.topdir = os.path.join(config.get('pungi', 'destdir'),
|
||||
config.get('pungi', 'version'),
|
||||
config.get('pungi', 'flavor'),
|
||||
config.get('pungi', 'variant'),
|
||||
'source', 'SRPMS')
|
||||
mypungi.doCreaterepo(comps=False)
|
||||
if opts.do_all or opts.do_createiso:
|
||||
|
|
@ -205,20 +205,23 @@ if __name__ == '__main__':
|
|||
|
||||
def set_config(option, opt_str, value, parser, config):
|
||||
config.set('pungi', option.dest, value)
|
||||
# When setting name, also set the iso_basename.
|
||||
if option.dest == 'name':
|
||||
config.set('pungi', 'iso_basename', value)
|
||||
|
||||
# Pulled in from config file to be cli options as part of pykickstart conversion
|
||||
parser.add_option("--name", dest="name", type="string",
|
||||
parser.add_option("--name", dest="family", type="string",
|
||||
action="callback", callback=set_config, callback_args=(config, ),
|
||||
help='the name for your distribution (defaults to "Fedora")')
|
||||
help='the name for your distribution (defaults to "Fedora"), DEPRECATED')
|
||||
parser.add_option("--family", dest="family", type="string",
|
||||
action="callback", callback=set_config, callback_args=(config, ),
|
||||
help='the family name for your distribution (defaults to "Fedora")')
|
||||
parser.add_option("--ver", dest="version", type="string",
|
||||
action="callback", callback=set_config, callback_args=(config, ),
|
||||
help='the version of your distribution (defaults to datestamp)')
|
||||
parser.add_option("--flavor", dest="flavor", type="string",
|
||||
parser.add_option("--flavor", dest="variant", type="string",
|
||||
action="callback", callback=set_config, callback_args=(config, ),
|
||||
help='the flavor of your distribution spin (optional)')
|
||||
help='the flavor of your distribution spin (optional), DEPRECATED')
|
||||
parser.add_option("--variant", dest="variant", type="string",
|
||||
action="callback", callback=set_config, callback_args=(config, ),
|
||||
help='the variant of your distribution spin (optional)')
|
||||
parser.add_option("--destdir", dest="destdir", type="string",
|
||||
action="callback", callback=set_config, callback_args=(config, ),
|
||||
help='destination directory (defaults to current directory)')
|
||||
|
|
@ -299,8 +302,8 @@ if __name__ == '__main__':
|
|||
if not opts.config:
|
||||
parser.error("Please specify a config file")
|
||||
|
||||
if not config.get('pungi', 'flavor').isalnum() and not config.get('pungi', 'flavor') == '':
|
||||
parser.error("Flavor must be alphanumeric")
|
||||
if not config.get('pungi', 'variant').isalnum() and not config.get('pungi', 'variant') == '':
|
||||
parser.error("Variant must be alphanumeric")
|
||||
|
||||
if opts.do_gather or opts.do_createrepo or opts.do_buildinstall or opts.do_createiso:
|
||||
opts.do_all = False
|
||||
|
|
@ -308,6 +311,12 @@ if __name__ == '__main__':
|
|||
if opts.arch and (opts.do_all or opts.do_buildinstall):
|
||||
parser.error("Cannot override arch while the BuildInstall stage is enabled")
|
||||
|
||||
# set the iso_basename.
|
||||
if not config.get('pungi', 'variant') == '':
|
||||
config.set('pungi', 'iso_basename', '%s-%s' % (config.get('pungi', 'family'), config.get('pungi', 'variant')))
|
||||
else:
|
||||
config.set('pungi', 'iso_basename', config.get('pungi', 'family'))
|
||||
|
||||
return (opts, args)
|
||||
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue