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)
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)