summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2013-11-06 14:13:56 -0600
committerSol Jerome <sol.jerome@gmail.com>2013-11-06 14:13:56 -0600
commit625ba3bbe8fbf7471bd179f5c3e01ef7e444651c (patch)
tree3d40fa1effcdb5f544b4ec2a6c16ab7fc0fb86df /tools
parented1271930d2a774bfc9d52c64e610083815075fd (diff)
downloadbcfg2-625ba3bbe8fbf7471bd179f5c3e01ef7e444651c.tar.gz
bcfg2-625ba3bbe8fbf7471bd179f5c3e01ef7e444651c.tar.bz2
bcfg2-625ba3bbe8fbf7471bd179f5c3e01ef7e444651c.zip
export: Fix pre/rc behavior for spec files
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/export.py47
1 files changed, 32 insertions, 15 deletions
diff --git a/tools/export.py b/tools/export.py
index 8e90b8766..6cd36a9b6 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -248,32 +248,49 @@ 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)
- if version_info['build'] == '':
- find_and_replace('misc/bcfg2.spec', 'Release: ',
- 'Release: 1\n',
- startswith=True,
+ if version_info['build'].startswith('rc'):
+ find_and_replace('misc/bcfg2.spec', 'global _rc ',
+ '%%global _rc %s\n' % version_info['build'],
dryrun=options.dryrun)
- find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
- 'Release: 1\n',
- startswith=True,
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _rc ',
+ '%%global _rc %s\n' % version_info['build'],
+ dryrun=options.dryrun)
+ elif version_info['build'].startswith('pre'):
+ find_and_replace('misc/bcfg2.spec', 'global _pre ',
+ '%%global _pre %s\n' % version_info['build'],
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _pre ',
+ '%%global _pre %s\n' % version_info['build'],
dryrun=options.dryrun)
else:
+ # comment out pre/rc
+ find_and_replace('misc/bcfg2.spec', 'global _pre ',
+ '#%%global _pre 2\n',
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _pre ',
+ '#%%global _pre 2\n',
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2.spec', 'global _rc ',
+ '#%%global _rc 1\n',
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _rc ',
+ '#%%global _rc 1\n',
+ dryrun=options.dryrun)
+
find_and_replace('misc/bcfg2.spec', 'Release: ',
- 'Release: 0.%s.%s\n' %
- (version_info['build'][-1], version_info['build']),
+ 'Release: 1%{?_pre_rc}%{?dist}\n',
+ startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
- 'Release: 0.%s.%s\n' %
- (version_info['build'][-1], version_info['build']),
+ 'Release: 1%{?_pre_rc}%{?dist}\n',
+ startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2.spec', '%setup',
- '%%setup -q -n %%{name}-%%{version}%s\n' %
- version_info['build'],
+ '%setup -q -n %{name}-%{version}%{?_pre_rc}\n',
startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2-selinux.spec', '%setup',
- '%%setup -q -n %%{name}-%%{version}%s\n' %
- version_info['build'],
+ '%setup -q -n %{name}-%{version}%{?_pre_rc}\n',
startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2.spec', 'BuildRoot',