aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2019-04-19 08:29:40 -0400
committerAnthony G. Basile <blueness@gentoo.org>2019-04-19 08:29:45 -0400
commit9d61dc4ca6b4a8f68806d336c5b6eb888332582e (patch)
tree321be878d1f4a51285a289325d62c1658e6b5a4d
parentgrs/MountDirectories.py: location of /usr/portage is configurable (diff)
downloadgrss-master.tar.gz
grss-master.tar.bz2
grss-master.zip
grs/Kernel.py: correctly parse vanilla-sourcesHEADmaster
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--grs/Kernel.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/grs/Kernel.py b/grs/Kernel.py
index 82e6d04..3abea6a 100644
--- a/grs/Kernel.py
+++ b/grs/Kernel.py
@@ -67,10 +67,15 @@ class Kernel():
pkg_name = flavor + '-sources-' + vanilla_version + '-' + revision
except AttributeError:
# Or the verison is of the form '4.0.6-hardened' with one -
- _match = re.search(r'(\S+?)-(\S+)', gentoo_version)
- vanilla_version = _match.group(1)
- flavor = _match.group(2)
- pkg_name = flavor + '-sources-' + vanilla_version
+ try:
+ _match = re.search(r'(\S+?)-(\S+)', gentoo_version)
+ vanilla_version = _match.group(1)
+ flavor = _match.group(2)
+ pkg_name = flavor + '-sources-' + vanilla_version
+ except AttributeError:
+ # Finally the verison is of the form '4.0.6' with no -
+ vanilla_version = gentoo_version
+ pkg_name = 'vanilla-sources-' + vanilla_version
pkg_name = '=sys-kernel/' + pkg_name
return (gentoo_version, pkg_name, has_modules)