summaryrefslogtreecommitdiffstats
path: root/tools/export.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2013-03-18 12:44:20 -0500
committerSol Jerome <sol.jerome@gmail.com>2013-03-18 12:45:05 -0500
commit2101d7fcfa20fcb65adfdf4f35896091f0979c23 (patch)
tree840b3c5c77d223ec1fcdc7bec0f1fc8c8eea9210 /tools/export.py
parent16bd2b37c091c83d1b706fd08117001934a8a746 (diff)
downloadbcfg2-2101d7fcfa20fcb65adfdf4f35896091f0979c23.tar.gz
bcfg2-2101d7fcfa20fcb65adfdf4f35896091f0979c23.tar.bz2
bcfg2-2101d7fcfa20fcb65adfdf4f35896091f0979c23.zip
export: Be more consistent with naming guidelines
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'tools/export.py')
-rwxr-xr-xtools/export.py38
1 files changed, 27 insertions, 11 deletions
diff --git a/tools/export.py b/tools/export.py
index 33c42d238..716c831d9 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -164,11 +164,17 @@ E.G. 1.2.0pre1 is a valid version.
print(help_message)
quit()
- rpmchangelog = ["* %s %s <%s> %s-0.0%s\n" %
- (datetime.datetime.now().strftime("%a %b %d %Y"),
- name, email,
- version_release, version_info['build']),
- "- New upstream release\n", "\n"]
+ if version_info['build'] == '':
+ rpmchangelog = ["* %s %s <%s> %s-1\n" %
+ (datetime.datetime.now().strftime("%a %b %d %Y"),
+ name, email, version_release),
+ "- New upstream release\n", "\n"]
+ else:
+ rpmchangelog = ["* %s %s <%s> %s-0.%s.%s\n" %
+ (datetime.datetime.now().strftime("%a %b %d %Y"),
+ name, email, version_release,
+ version_info['build'][-1], version_info['build']),
+ "- New upstream release\n", "\n"]
# write out the new RPM changelog
specs = ["misc/bcfg2.spec", "misc/bcfg2-selinux.spec", "redhat/bcfg2.spec.in"]
@@ -236,12 +242,22 @@ E.G. 1.2.0pre1 is a valid version.
find_and_replace('misc/bcfg2-selinux.spec', 'Version:',
'Version: %s\n' % version_release,
dryrun=options.dryrun)
- find_and_replace('misc/bcfg2.spec', 'Release: ',
- 'Release: 0.0%s\n' % version_info['build'],
- dryrun=options.dryrun)
- find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
- 'Release: 0.0%s\n' % version_info['build'],
- dryrun=options.dryrun)
+ if version_info['build'] == '':
+ find_and_replace('misc/bcfg2.spec', 'Release: ',
+ 'Release: 1\n',
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
+ 'Release: 1\n',
+ dryrun=options.dryrun)
+ else:
+ find_and_replace('misc/bcfg2.spec', 'Release: ',
+ 'Release: 0.%s.%s\n' %
+ (version_info['build'][-1], version_info['build']),
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
+ 'Release: 0.%s.%s\n' %
+ (version_info['build'][-1], version_info['build']),
+ dryrun=options.dryrun)
find_and_replace('misc/bcfg2.spec', '%setup',
'%%setup -q -n %%{name}-%%{version}%s\n' %
version_info['build'],