summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2012-10-30 16:54:05 -0500
committerSol Jerome <sol.jerome@gmail.com>2012-10-30 16:54:05 -0500
commite404baf33dad8902f5b6d11e1020d7489d34b671 (patch)
treeef1bb02e028f4c9ef22f758d3e1e13ffbfb2bfd1 /tools
parent7383624ac422ccbfb062e13d7bd901d39f942286 (diff)
downloadbcfg2-e404baf33dad8902f5b6d11e1020d7489d34b671.tar.gz
bcfg2-e404baf33dad8902f5b6d11e1020d7489d34b671.tar.bz2
bcfg2-e404baf33dad8902f5b6d11e1020d7489d34b671.zip
export.py: Add bcfg2-selinux spec file updates
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/export.py39
1 files changed, 33 insertions, 6 deletions
diff --git a/tools/export.py b/tools/export.py
index 3b52b35bb..8604c7f2f 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -137,14 +137,13 @@ E.G. 1.2.0pre1 is a valid version.
tarname = '/tmp/%s-%s.tar.gz' % (pkgname, version)
newchangelog = \
-"""bcfg2 (%s%s-0.0) unstable; urgency=low
+"""bcfg2 (%s-0.0) unstable; urgency=low
* New upstream release
-- %s <%s> %s
-""" % (version_release,
- version_info['build'],
+""" % (version,
name,
email,
formatdate(localtime=True))
@@ -174,7 +173,7 @@ E.G. 1.2.0pre1 is a valid version.
# write out the new RPM changelog
specs = ["misc/bcfg2.spec", "redhat/bcfg2.spec.in"]
if options.dryrun:
- print("*** Add the following to the top of the %changelog section in %s:\n%s\n"
+ print("*** Add the following to the top of the %%changelog section in %s:\n%s\n"
% (rpmchangelog, " and ".join(specs)))
else:
for fname in specs:
@@ -197,7 +196,7 @@ E.G. 1.2.0pre1 is a valid version.
# Update redhat directory versions
if options.dryrun:
- print("*** Replace redhat/VERIONS content with '%s'."
+ print("*** Replace redhat/VERSIONS content with '%s'."
% version_release)
print("*** Replace redhat/RELEASE content with '%s'."
% version_info['build'])
@@ -230,13 +229,41 @@ E.G. 1.2.0pre1 is a valid version.
'__version__ =',
'__version__ = "%s"\n' % version,
dryrun=options.dryrun)
- # replace version in misc/bcfg2.spec
+ # replace version in misc/bcfg2.spec and misc/bcfg2-selinux.spec
find_and_replace('misc/bcfg2.spec', 'Version:',
'Version: %s\n' % version_release,
dryrun=options.dryrun)
+ 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)
+ find_and_replace('misc/bcfg2.spec', '%setup',
+ '%%setup -q -n %%{name}-%%{version}%s\n' %
+ version_info['build'],
+ startswith=True,
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', '%setup',
+ '%%setup -q -n %%{name}-%%{version}%s\n' %
+ version_info['build'],
+ startswith=True,
+ dryrun=options.dryrun)
+ # fix pre problem noted in
+ # http://trac.mcs.anl.gov/projects/bcfg2/ticket/1129
+ find_and_replace('misc/bcfg2.spec',
+ 'Source0',
+ 'Source0: ftp://ftp.mcs.anl.gov/pub/bcfg/%%{name}-%%{version}%s.tar.gz\n' % version_info["build"],
+ startswith=True,
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec',
+ 'Source0',
+ 'Source0: ftp://ftp.mcs.anl.gov/pub/bcfg/%%{name}-%%{version}%s.tar.gz\n' % version_info["build"],
+ startswith=True,
+ dryrun=options.dryrun)
# update the version in reports
find_and_replace('src/lib/Bcfg2/Reporting/templates/base.html',
'Bcfg2 Version',