Message ID | 20230630171017.1072241-2-ashelat@redhat.com |
---|---|
State | New |
Headers | show |
Series | [v3,1/2] Fixed bug in kcompile where run would fail if kcompile-source version had the form x.y instead of x.y.z | expand |
On Fri, 30 Jun 2023, Anubhav Shelat wrote: > Edited code, from previous commit that allowed -S to download kernel > versions of the form x.y, to exclude try-except block. > > Signed-off-by: Anubhav Shelat <ashelat@redhat.com> > --- > rteval-cmd | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/rteval-cmd b/rteval-cmd > index d019da41d8d3..44921dfe0764 100755 > --- a/rteval-cmd > +++ b/rteval-cmd > @@ -291,11 +291,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/" > > -- > 2.39.3 > > - Modified comment Signed-off-by: John Kacur <jkacur@redhat.com>
diff --git a/rteval-cmd b/rteval-cmd index d019da41d8d3..44921dfe0764 100755 --- a/rteval-cmd +++ b/rteval-cmd @@ -291,11 +291,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/"
Edited code, from previous commit that allowed -S to download kernel versions of the form x.y, to exclude try-except block. Signed-off-by: Anubhav Shelat <ashelat@redhat.com> --- rteval-cmd | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)