diff options
author | Anubhav Shelat <ashelat@redhat.com> | 2023-06-30 13:05:42 -0400 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2023-06-30 13:48:46 -0400 |
commit | 16596a318675f23a5ef15566844d427efa87e6c7 (patch) | |
tree | c42605c6e952e25a6537dc176a202c43d4e5ffb6 | |
parent | e6a2c2fdc43c3912c6c34c48f64fc2b62981d44d (diff) | |
download | rteval-16596a318675f23a5ef15566844d427efa87e6c7.tar.gz |
Edited code from previous commit to exclude try-except block
Edited code, from previous commit that allowed -S to download kernel
versions of the form x.y, to use an improved regular expression
and remove an unecessary try/except block
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
- Modified comment
Signed-off-by: John Kacur <jkacur@redhat.com>
-rwxr-xr-x | rteval-cmd | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -306,11 +306,7 @@ if __name__ == '__main__': kernel_prefix = re.search(r"\d{1,2}\.\d{1,3}\-[a-z]*\d{1,2}", rtevcfg.srcdownload).group(0) url = "https://git.kernel.org/torvalds/t/" else: - try: - kernel_prefix = re.search(r"\d{1,2}\.\d{1,3}\.*\d{1,2}", rtevcfg.srcdownload).group(0) - except AttributeError: - # if kernel version specified is of the form x.x and not x.x.x - kernel_prefix = re.search(r"\d{1,2}\.\d{1,3}", rtevcfg.srcdownload).group(0) + kernel_prefix = re.search(r"(\d{1,2}\.\d{1,3}\.\d{1,3})|(\d{1,2}\.\d{1,3})", rtevcfg.srcdownload).group(0) major_version = re.search(r"\d{1,2}", kernel_prefix).group(0) url = "https://kernel.org/pub/linux/kernel/v" + major_version + ".x/" |