]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
refactoring in progress
authorHolger Levsen <holger@layer-acht.org>
Sun, 18 Sep 2011 15:13:45 +0000 (17:13 +0200)
committerHolger Levsen <holger@layer-acht.org>
Sun, 18 Sep 2011 15:13:45 +0000 (17:13 +0200)
kernel_inpbuilder.py

index 3d8a9769be2fc2771f6d0fb31c80bb5864dfc7f7..123705ccf4011b74e2b87389007e560c84872b04 100644 (file)
@@ -217,8 +217,6 @@ def build_kernel(version, revision, parallel_jobs='auto', distcc=False):
             'calling "%s" for compiling the kernel' %(' '.join(cmd))
     )
 
-    os.putenv('LOCALVERSION', '')
-    os.environ['LOCALVERSION'] = ''
     if distcc:
         os.environ['MAKEFLAGS'] = 'CC=distcc'
         os.putenv('MAKEFLAGS', 'CC=distcc')
@@ -244,11 +242,6 @@ def read_file(path):
         return result
 
 def add_local_version_to_config(kernel_build_revision):
-    if not os.path.exists(KERNEL_CONFIG_PATH):
-        raise Exception(
-                'No config file found at %s' %(KERNEL_CONFIG_PATH)
-        )
-    kernel_config = read_file(KERNEL_CONFIG_PATH)
     # don't put the branch names into the packages names
     if GIT_BRANCH_NAME.startswith('master-'):
         flavour = GIT_BRANCH_NAME[7:]
@@ -263,39 +256,6 @@ def add_local_version_to_config(kernel_build_revision):
         flavour = 'none'
 
     localversion = 'profitbricks-%s' % flavour
-#    for lino, line in kernel_config.iteritems():
-#        try:
-#            key, value = CREG_KERNEL_CONFIG_DELIM.split(line)
-#        except ValueError:
-#            # found a comment line or something else
-#            # we dont want.
-#            continue
-#        if key == 'CONFIG_LOCALVERSION':
-#            value = localversion
-#            kernel_config.update(((lino, '%s="%s"\n' %(key, value)),))
-#            break
-#    else:
-#        # no CONFIG_LOCALVERSION in kernel config
-#        lino += 1
-#        kernel_config.setdefault(
-#                lino,
-#                'CONFIG_LOCALVERSION="%s"\n' %(localversion)
-#        )
-#    logger.info('CONFIG_LOCALVERSION set to %s' % localversion)
-#
-#    try:
-#        fh = open(KERNEL_CONFIG_PATH, 'w', 1)
-#    except:
-#        raise
-#    else:
-#        for lino, line in sorted(
-#                kernel_config.iteritems(),
-#                key=lambda x: x[0]
-#        ):
-#            fh.write(line)
-#        fh.close()
-#        return localversion
-#    return False
     return localversion
 
 def exit(retcode):
@@ -416,16 +376,8 @@ if __name__ == '__main__':
         exit(ERROR)
 
     new_version = REVISION
-    try:
-        kernel_version = add_local_version_to_config(new_version)
-    except Exception, error:
-        logger.exception(error)
-        exit(ERROR)
-    else:
-        logger.info(
-                'updated CONFIG_LOCALVERSION in %s to %s'
-                %(KERNEL_CONFIG_PATH, new_version)
-        )
+    kernel_version = add_local_version_to_config(new_version)
+    logger.info('REVISION = %s, kernel_version = %s' %(REVISION,kernel_version))
 
     logger.debug('changing dir to %s' %(GIT_TARGET_DIR))
     os.chdir(GIT_TARGET_DIR)