[PATCH 4/6] Add --newrelease to makebumpver
Chris Lumens
clumens at redhat.com
Wed May 20 14:43:26 UTC 2015
From: "Brian C. Lane" <bcl at redhat.com>
This also moves Release handling into configure.ac which used to pull it
from anaconda.spec.in, it was always a 1 so move that into a place where
it can easily make the substitution for the new release value.
Related: rhbz#1196721
---
anaconda.spec.in | 2 +-
configure.ac | 4 +---
scripts/makebumpver | 19 +++++++++++++------
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 62652b8..28df97f 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -3,7 +3,7 @@
Summary: Graphical system installer
Name: anaconda
Version: @PACKAGE_VERSION@
-Release: 1%{?dist}
+Release: @PACKAGE_RELEASE@%{?dist}
License: GPLv2+
Group: Applications/System
URL: http://fedoraproject.org/wiki/Anaconda
diff --git a/configure.ac b/configure.ac
index 2d13172..66accb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,9 +161,7 @@ CFLAGS="`cflags_filter $CFLAGS`"
# all libraries we checked for.
LIBS=
-# Get the release number from the spec file
-rel="`awk '/Release:/ { split($2, r, "%"); print r[[1]] }' $srcdir/anaconda.spec.in`"
-AC_SUBST(PACKAGE_RELEASE, [$rel])
+AC_SUBST(PACKAGE_RELEASE, [1])
# Perform arch related tests
AC_CANONICAL_BUILD
diff --git a/scripts/makebumpver b/scripts/makebumpver
index 722984b..7a052c2 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -64,6 +64,7 @@ class MakeBumpVer:
self.name = kwargs.get('name')
self.version = kwargs.get('version')
self.release = kwargs.get('release')
+ self.new_release = kwargs.get('new_release') or self.release
self.bugreport = kwargs.get('bugreport')
self.ignore = kwargs.get('ignore')
@@ -395,6 +396,9 @@ class MakeBumpVer:
newVersion,
self.bugreport)
+ i = l.index("AC_SUBST(PACKAGE_RELEASE, [1])\n")
+ l[i] = "AC_SUBST(PACKAGE_RELEASE, [%s])\n" % self.new_release
+
f = open(self.configure, 'w')
f.writelines(l)
f.close()
@@ -415,7 +419,7 @@ class MakeBumpVer:
today = datetime.date.today()
stamp = today.strftime("%a %b %d %Y")
f.write("* %s %s <%s> - %s-%s\n" % (stamp, self.gituser, self.gitemail,
- newVersion, self.release))
+ newVersion, self.new_release))
for msg, rhbz in rpmlog:
msg = re.sub('(?<!%)%%(?!%)|(?<!%%)%(?!%%)', '%%', msg)
@@ -512,7 +516,7 @@ class MakeBumpVer:
log.warning("jenkins test results do not pass; ignoring for now")
newVersion = self._incrementVersion()
- fixedIn = "%s-%s-%s" % (self.name, newVersion, self.release)
+ fixedIn = "%s-%s-%s" % (self.name, newVersion, self.new_release)
rpmlog = self._rpmLog(fixedIn)
self._writeNewConfigure(newVersion)
@@ -524,6 +528,7 @@ def usage(cmd):
sys.stdout.write(" -n, --name Package name.\n")
sys.stdout.write(" -v, --version Current package version number.\n")
sys.stdout.write(" -r, --release Package release number.\n")
+ sys.stdout.write(" --newrelease Value for release in the .spec file.\n")
sys.stdout.write(" -b, --bugreport Bug reporting email address.\n")
sys.stdout.write(" -i, --ignore Comma separated list of git commits to ignore.\n")
sys.stdout.write(" -m, --map Comma separated list of FEDORA_BZ=RHEL_BZ mappings.\n")
@@ -543,14 +548,14 @@ def main(argv):
configure = os.path.realpath(cwd + '/configure.ac')
spec = os.path.realpath(cwd + '/anaconda.spec.in')
zanata_config = os.path.realpath(cwd + '/zanata.xml')
- name, version, release, bugreport = None, None, None, None
+ name, version, release, new_release, bugreport = None, None, None, None, None
ignore, bugmap = None, None
show_help, unknown, skip_acks, skip_all, skip_zanata, skip_jenkins = False, False, False, False, False, False
opts = []
try:
- opts, _args = getopt.getopt(sys.argv[1:], 'n:v:r:b:i:m:d?',
- ['name=', 'version=', 'release=',
+ opts, _args = getopt.getopt(sys.argv[1:], 'n:v:r:b:i:m:sSd?',
+ ['name=', 'version=', 'release=', "newrelease=",
'bugreport=', 'ignore=', 'map=',
'debug', 'help', 'skip-zanata', 'skip-jenkins'])
except getopt.GetoptError:
@@ -563,6 +568,8 @@ def main(argv):
version = a
elif o in ('-r', '--release'):
release = a
+ elif o in ('--newrelease'):
+ new_release = a
elif o in ('-b', '--bugreport'):
bugreport = a
elif o in ('-i', '--ignore'):
@@ -616,7 +623,7 @@ def main(argv):
bugreport=bugreport, ignore=ignore, bugmap=bugmap,
configure=configure, spec=spec, skip_acks=skip_acks,
skip_all=skip_all, zanata_config=zanata_config, skip_zanata=skip_zanata,
- skip_jenkins=skip_jenkins)
+ skip_jenkins=skip_jenkins, new_release=new_release)
mbv.run()
if __name__ == "__main__":
--
2.2.2
More information about the anaconda-patches
mailing list