From: Holger Levsen Date: Tue, 20 Sep 2011 10:25:07 +0000 (+0200) Subject: include pb_version in debian version number X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=3ef45df89ac4004730e5d0116cb3f978d07ab41c;p=profitbricks%2Fjenkins-build-scripts.git include pb_version in debian version number --- diff --git a/kernel_inpbuilder.py b/kernel_inpbuilder.py index 757e43c..c50f489 100644 --- a/kernel_inpbuilder.py +++ b/kernel_inpbuilder.py @@ -253,17 +253,24 @@ def create_file(path,data): raise def determine_kernel_flavour(): + pb_version_path = 'pb_version' + if not os.path.exists(pb_version_path): + pb_version = '0' + else: + fh = open(pb_version_path) + pb_version = fh.readline().rstrip() + fh.close() + # strip the first 6 characters ("linux-") and the last 4 (".git") flavour = GIT_REPO_NAME[6:-4] # slightly different version numbers per branch if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix'): - # FIXME: not -build... - debian_version = '$(version)-build%s' % REVISION + debian_version = '$(version)-%s-%s' % (pb_version, REVISION) elif GIT_BRANCH_NAME.startswith('release'): - debian_version = '$(version)~rc%s' % REVISION + debian_version = '$(version)-%s~rc%s' % (pb_version, REVISION) else: - debian_version = '$(version)~develop%s' % REVISION + debian_version = '$(version)-%s~develop%s' % (pb_version, REVISION) # create appropriate /etc/kernel-pkg.conf content = 'maintainer := Profitbricks GmbH\nemail := %s\npriority := Low\ndebian = %s\n' % (GIT_COMMITTER_EMAIL, debian_version) @@ -271,8 +278,8 @@ def determine_kernel_flavour(): logger.info('/etc/kernel-pkg.conf created with this content: \n%s' % content) # return safely - localversion = 'profitbricks-%s' % flavour - return localversion + kernel_flavour = 'profitbricks-%s' % flavour + return kernel_flavour def exit(retcode): logger.info('Exit with %s', retcode)