From 35ae981a6197d0552888b33e3b56adfb447f3f4a Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 11 Jul 2013 13:58:32 -0400 Subject: Improve SPEC generation, conforming to new standard --- ipsutils-newspec.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'ipsutils-newspec.py') diff --git a/ipsutils-newspec.py b/ipsutils-newspec.py index 62d02c7..8c58332 100755 --- a/ipsutils-newspec.py +++ b/ipsutils-newspec.py @@ -28,21 +28,25 @@ if args.spec: spec_template.key_dict['name'] = os.path.splitext(os.path.basename(spec))[0] spec_template.key_dict['release'] = '1' - print("Generating '{}' spec file".format(spec)) + print("Generating '{}' spec file".format(os.path.basename(spec))) fp = file(spec, 'w+') for key, val in spec_template.key_dict.items(): - if key is 'description' \ - or key is 'classification' \ - or key is 'summary' \ - or key is 'maintainer': - val = '""' + # Write non-essential keywords, commented + if key is 'repackage' \ + or key is 'badpath': + key = '#' + key + # Write initial classification string (user needs to fill it in) + if key is 'classification': + val = 'org.opensolaris.category.2008:' + if key is 'upstream_url': + val = 'http://' fp.write('{}: {}\n'.format(key, val)) fp.write('\n') for key in spec_template.script_dict.keys(): fp.write('\n') fp.write('%{}\n\n'.format(key)) - fp.write('%end\n') + fp.write('%end\n\n') fp.flush() fp.close() else: -- cgit