From patchwork Fri Jun 15 20:44:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 930251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 416stN6h9Yz9s47; Sat, 16 Jun 2018 06:44:44 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fTvaI-00048Z-R2; Fri, 15 Jun 2018 20:44:38 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fTvaG-000481-W3 for kernel-team@lists.ubuntu.com; Fri, 15 Jun 2018 20:44:36 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fTvaG-0000AC-JY for kernel-team@lists.ubuntu.com; Fri, 15 Jun 2018 20:44:36 +0000 Received: from kamal by fourier with local (Exim 4.86_2) (envelope-from ) id 1fTvaE-00044s-DQ for kernel-team@lists.ubuntu.com; Fri, 15 Jun 2018 13:44:34 -0700 From: Kamal Mostafa To: kernel-team@lists.ubuntu.com Subject: [kteam-tools][PATCH 2/2] verify-release-ready: rename internal cl variables Date: Fri, 15 Jun 2018 13:44:32 -0700 Message-Id: <1529095472-15625-3-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529095472-15625-1-git-send-email-kamal@canonical.com> References: <1529095472-15625-1-git-send-email-kamal@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" No functional change. Rename the internal 'cl' variables to match their index positions in the changelog array: Variable cl0 (not cl1) = the changelog[0] entry. Variable cl1 (not cl2) = the changelog[1] entry. Signed-off-by: Kamal Mostafa --- maintscripts/verify-release-ready | 104 +++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/maintscripts/verify-release-ready b/maintscripts/verify-release-ready index 1e6982e..713bf00 100755 --- a/maintscripts/verify-release-ready +++ b/maintscripts/verify-release-ready @@ -74,75 +74,75 @@ class VerifyReleaseReady(): if s.args.verbose: stdo(colored(msg + '\n', 'blue')) - def verify_linux(s, cl1, cl2): - if '-' not in cl1['version']: + def verify_linux(s, cl0, cl1): + if '-' not in cl0['version']: raise AppError("The version string is not well formed (missing '-').") - (cl1_version, abi_build) = cl1['version'].split('-') # Current version line + (cl0_version, abi_build) = cl0['version'].split('-') # Current version line + cl0_abi = cl0['ABI'] + cl0_build = cl0['upload-number'] + + (cl1_version, abi_build) = cl1['version'].split('-') # Previous version line cl1_abi = cl1['ABI'] cl1_build = cl1['upload-number'] - (cl2_version, abi_build) = cl2['version'].split('-') # Previous version line - cl2_abi = cl2['ABI'] - cl2_build = cl2['upload-number'] - # Verify the version information in the changelog # while True: # Check: That the release information is correct. # - msg = 'release (%s)' % (cl1['release']) + msg = 'release (%s)' % (cl0['release']) kernel_series = KernelSeries() - series = kernel_series.lookup_series(codename=cl1['release']) + series = kernel_series.lookup_series(codename=cl0['release']) if not series: s.status(msg, False) - s.verbose("invalid series specified '%s'" % (cl1['release'],)) + s.verbose("invalid series specified '%s'" % (cl0['release'],)) else: s.status(msg, True) - msg = 'package (%s)' % (cl1['package']) + msg = 'package (%s)' % (cl0['package']) source = None if series: - source = series.lookup_source(cl1['package']) + source = series.lookup_source(cl0['package']) if not source: s.status(msg, False) - s.verbose("invalid source specified '%s' not found in series '%s'" % (cl1['package'], cl1['release'])) + s.verbose("invalid source specified '%s' not found in series '%s'" % (cl0['package'], cl0['release'])) else: s.status(msg, True) - msg = 'version (%s)' % (cl1['version']) + msg = 'version (%s)' % (cl0['version']) if source: found = False for version in source.versions: - if cl1['version'].startswith(version + '-'): + if cl0['version'].startswith(version + '-'): found = True break if not found: s.status(msg, False) - s.verbose("invalid version specified '%s' not found in series '%s' source '%s'" % (cl1['version'], cl1['package'], cl1['release'])) + s.verbose("invalid version specified '%s' not found in series '%s' source '%s'" % (cl0['version'], cl0['package'], cl0['release'])) else: s.status(msg, True) # Check: Make sure the ABI is *always* incremented # - msg = 'ABI bump (%d)' % (int(cl1_abi)) - if int(cl1_abi) <= int(cl2_abi): + msg = 'ABI bump (%d)' % (int(cl0_abi)) + if int(cl0_abi) <= int(cl1_abi): s.status(msg, False) - s.verbose("No ABI bump: %d <= %d" % (int(cl1_abi), int(cl2_abi))) + s.verbose("No ABI bump: %d <= %d" % (int(cl0_abi), int(cl1_abi))) else: s.status(msg, True) # Check: Make sure the current version is correctly incremented from the previous one. # - msg = 'build number (%d)' % (int(cl2_build) + 1) - if int(cl1_build) != int(cl2_build) + 1: + msg = 'build number (%d)' % (int(cl1_build) + 1) + if int(cl0_build) != int(cl1_build) + 1: s.status(msg, False) - s.verbose("expected %d but got: %d" % (int(cl2_build), int(cl1_build))) + s.verbose("expected %d but got: %d" % (int(cl1_build), int(cl0_build))) else: s.status(msg, True) # Check: Make sure that the abi directory has the previous version - v = cl2['version'] + v = cl1['version'] if '~' in v: v = v.split('~', 1)[0] msg = 'previous abi present (%s)' % (v) @@ -201,23 +201,23 @@ class VerifyReleaseReady(): if 'Signed-off-by' not in line: commit.append(line) - version = '%s-%s.%s' % (cl1['linux-version'], cl1['ABI'], cl1['upload-number']) + version = '%s-%s.%s' % (cl0['linux-version'], cl0['ABI'], cl0['upload-number']) - (closed, expected_re) = s.verify_closing_commit(cl1, commit, version) + (closed, expected_re) = s.verify_closing_commit(cl0, commit, version) # Construct the expected tag, and verify that it matches the # latest commit tag # - pkg = cl1['package'] + pkg = cl0['package'] if pkg.startswith('linux-lts'): tag_prefix = 'Ubuntu-lts' - v = cl1['version'] + v = cl0['version'] elif pkg.startswith('linux-hwe'): tag_prefix = 'Ubuntu-hwe' - v = cl1['version'] + v = cl0['version'] elif Debian.is_backport(): tag_prefix = pkg.replace('linux', 'Ubuntu') - v = cl1['version'] + v = cl0['version'] else: tag_prefix = pkg.replace('linux', 'Ubuntu') v = version @@ -280,13 +280,13 @@ class VerifyReleaseReady(): s.verify_content() - def verify_closing_commit(s, cl1, commit, version): + def verify_closing_commit(s, cl0, commit, version): # **NOTE: Because we are inconsistent with the exact text used in the last commit # I'm loosing up the matching a bit but making sure that what is in the # last commit matches the tag # closed = True - expected = '^UBUNTU: (Ubuntu[-\S]*-(%s|%s))$' % (version, cl1['version']) + expected = '^UBUNTU: (Ubuntu[-\S]*-(%s|%s))$' % (version, cl0['version']) m = re.match(expected, commit[0]) msg = 'closing release commit' if len(commit) != 1: # There should only be a single line in the commit @@ -473,18 +473,18 @@ class VerifyReleaseReady(): else: s.status('final commit content', True) - def verify_linux_meta(s, cl1, cl2): - cl1_build = cl1['upload-number'] + def verify_linux_meta(s, cl0, cl1): + cl0_build = cl0['upload-number'] - cl2_build = cl2['upload-number'] + cl1_build = cl1['upload-number'] while True: # Check: Make sure the current version is correctly incremented from the previous one. # - msg = 'build number (%d)' % (int(cl2_build) + 1) - if int(cl1_build) != int(cl2_build) + 1: + msg = 'build number (%d)' % (int(cl1_build) + 1) + if int(cl0_build) != int(cl1_build) + 1: s.status(msg, False) - s.verbose("expected %d but got: %d" % (int(cl2_build) + 1, int(cl1_build))) + s.verbose("expected %d but got: %d" % (int(cl1_build) + 1, int(cl0_build))) break s.status(msg, True) @@ -501,8 +501,8 @@ class VerifyReleaseReady(): if 'Signed-off-by' not in line: commit.append(line) - version = '%s.%s.%s' % (cl1['linux-version'], cl1['ABI'], cl1['upload-number']) - (closed, expected) = s.verify_closing_commit(cl1, commit, version) + version = '%s.%s.%s' % (cl0['linux-version'], cl0['ABI'], cl0['upload-number']) + (closed, expected) = s.verify_closing_commit(cl0, commit, version) if closed: s.verify_tag(log, expected) @@ -574,29 +574,29 @@ class VerifyReleaseReady(): changelog = Debian.changelog() - cl1 = changelog[0] + cl0 = changelog[0] if s.args.verbose: s.verbose('\n') s.verbose('New version information:') - for k in cl1: - s.verbose('%15s : %s' % (k, cl1[k])) + for k in cl0: + s.verbose('%15s : %s' % (k, cl0[k])) - cl2 = changelog[1] + cl1 = changelog[1] if s.args.verbose: s.verbose('\n') s.verbose('Previous version information:') - for k in cl2: - s.verbose('%15s : %s' % (k, cl2[k])) - if cl1['package'] in kernel_packages: - s.verify_linux(cl1, cl2) - elif cl1['package'] in non_kernel_packages: - s.verify_linux_meta(cl1, cl2) + for k in cl1: + s.verbose('%15s : %s' % (k, cl1[k])) + if cl0['package'] in kernel_packages: + s.verify_linux(cl0, cl1) + elif cl0['package'] in non_kernel_packages: + s.verify_linux_meta(cl0, cl1) else: - stdo(colored('Unrecognised package: %s\n' % cl1['package'], 'yellow')) + stdo(colored('Unrecognised package: %s\n' % cl0['package'], 'yellow')) stdo(colored(' Trying non-kernel package verification...\n', 'yellow')) - s.verify_linux_meta(cl1, cl2) + s.verify_linux_meta(cl0, cl1) stdo(colored(' Trying kernel package verification...\n', 'yellow')) - s.verify_linux(cl1, cl2) + s.verify_linux(cl0, cl1) # Handle the user presses . #