diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2015-10-08 13:26:01 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-10-08 13:26:01 -0400 |
commit | ddfe7d46bafa8875b43f86c8310e22bf7243e7a1 (patch) | |
tree | 1e73844993da7af7d5c89229332ceada4e10efe3 /grs/Kernel.py | |
parent | grs/Populate.py: use isinstance() instead of type(). (diff) | |
download | grss-ddfe7d46bafa8875b43f86c8310e22bf7243e7a1.tar.gz grss-ddfe7d46bafa8875b43f86c8310e22bf7243e7a1.tar.bz2 grss-ddfe7d46bafa8875b43f86c8310e22bf7243e7a1.zip |
lint: rename internal variables.
Diffstat (limited to 'grs/Kernel.py')
-rw-r--r-- | grs/Kernel.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/grs/Kernel.py b/grs/Kernel.py index 326b56c..cd2ecee 100644 --- a/grs/Kernel.py +++ b/grs/Kernel.py @@ -41,8 +41,8 @@ class Kernel(): def parse_kernel_config(self): """ Parse the version to be built/installed from the kernel-config file. """ - with open(self.kernel_config, 'r') as f: - lines = f.readlines() + with open(self.kernel_config, 'r') as _file: + lines = _file.readlines() # Are we building a modular kernel or statically linked? has_modules = 'CONFIG_MODULES=y\n' in lines # The third line is the version line in the kernel config file. @@ -50,20 +50,20 @@ class Kernel(): # The version line looks like the following: # Linux/x86 4.0.6-hardened-r2 Kernel Configuration # The 2nd group contains the version. - m = re.search(r'^#\s+(\S+)\s+(\S+).+$', version_line) - gentoo_version = m.group(2) + _match = re.search(r'^#\s+(\S+)\s+(\S+).+$', version_line) + gentoo_version = _match.group(2) try: # Either the verison is of the form '4.0.6-hardened-r2' with two -'s - m = re.search(r'(\S+?)-(\S+?)-(\S+)', gentoo_version) - vanilla_version = m.group(1) - flavor = m.group(2) - revision = m.group(3) + _match = re.search(r'(\S+?)-(\S+?)-(\S+)', gentoo_version) + vanilla_version = _match.group(1) + flavor = _match.group(2) + revision = _match.group(3) pkg_name = flavor + '-sources-' + vanilla_version + '-' + revision except AttributeError: # Or the verison is of the form '4.0.6-hardened' with one - - m = re.search(r'(\S+?)-(\S+)', gentoo_version) - vanilla_version = m.group(1) - flavor = m.group(2) + _match = re.search(r'(\S+?)-(\S+)', gentoo_version) + vanilla_version = _match.group(1) + flavor = _match.group(2) pkg_name = flavor + '-sources-' + vanilla_version pkg_name = '=sys-kernel/' + pkg_name return (gentoo_version, pkg_name, has_modules) |