diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2013-07-11 13:58:32 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2013-07-11 13:58:32 -0400 |
commit | 35ae981a6197d0552888b33e3b56adfb447f3f4a (patch) | |
tree | 6e0294d4780518e8944dc7a8b505f97adf0312a0 | |
parent | 78918635df518fd4dce6efb421d0b52c35204eab (diff) | |
download | ipsutils-35ae981a6197d0552888b33e3b56adfb447f3f4a.tar.gz |
Improve SPEC generation, conforming to new standard
-rwxr-xr-x | ipsutils-newspec.py | 18 |
1 files changed, 11 insertions, 7 deletions
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: |