* [PATCH 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
@ 2023-06-30 17:10 Anubhav Shelat
2023-06-30 17:10 ` [PATCH v3 2/2] Edited code from previous commit to exclude try-except block Anubhav Shelat
2023-06-30 17:47 ` [PATCH 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 John Kacur
0 siblings, 2 replies; 4+ messages in thread
From: Anubhav Shelat @ 2023-06-30 17:10 UTC (permalink / raw)
To: linux-rt-users; +Cc: kcarcia, Anubhav Shelat
Fixed bug in kcompile where run would fail if kcompile-source version
had the form x.y instead of x.y.z
Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
---
rteval/modules/loads/kcompile.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
index 35ee5cbbb52d..92442468febf 100644
--- a/rteval/modules/loads/kcompile.py
+++ b/rteval/modules/loads/kcompile.py
@@ -175,7 +175,7 @@ class Kcompile(CommandLineLoad):
if 'rc' in self._cfg.source:
tarfile_prefix = re.search(r"\d{1,2}\.\d{1,3}\-[a-z]*\d{1,2}", self._cfg.source).group(0)
else:
- tarfile_prefix = re.search(r"\d{1,2}\.\d{1,3}\.*\d{1,2}", self._cfg.source).group(0)
+ tarfile_prefix = re.search(r"(\d{1,2}\.\d{1,3}\.\d{1,3})|(\d{1,2}\.\d{1,3})", self._cfg.source).group(0)
# either a tar.xz or tar.gz might exist. Check for both.
xz_file = os.path.join(self.srcdir,"linux-" + tarfile_prefix + ".tar.xz" )
@@ -193,7 +193,7 @@ class Kcompile(CommandLineLoad):
# find our source tarball
if self._cfg.source:
self.source = self._find_tarball()
- kernel_prefix = re.search(r"linux-\d{1,2}\.\d{1,3}\.*\d{1,2}", self.source).group(0)
+ kernel_prefix = re.search(r"(linux-\d{1,2}\.\d{1,3}\.\d{1,3})|(linux-\d{1,2}\.\d{1,3})", self.source).group(0)
else:
tarfiles = glob.glob(os.path.join(self.srcdir, f"{DEFAULT_KERNEL_PREFIX}*"))
if tarfiles:
--
2.39.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v3 2/2] Edited code from previous commit to exclude try-except block
2023-06-30 17:10 [PATCH 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 Anubhav Shelat
@ 2023-06-30 17:10 ` Anubhav Shelat
2023-06-30 17:50 ` John Kacur
2023-06-30 17:47 ` [PATCH 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 John Kacur
1 sibling, 1 reply; 4+ messages in thread
From: Anubhav Shelat @ 2023-06-30 17:10 UTC (permalink / raw)
To: linux-rt-users; +Cc: kcarcia, Anubhav Shelat
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 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
2023-06-30 17:10 [PATCH 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 Anubhav Shelat
2023-06-30 17:10 ` [PATCH v3 2/2] Edited code from previous commit to exclude try-except block Anubhav Shelat
@ 2023-06-30 17:47 ` John Kacur
1 sibling, 0 replies; 4+ messages in thread
From: John Kacur @ 2023-06-30 17:47 UTC (permalink / raw)
To: Anubhav Shelat; +Cc: linux-rt-users, kcarcia
On Fri, 30 Jun 2023, Anubhav Shelat wrote:
> Fixed bug in kcompile where run would fail if kcompile-source version
> had the form x.y instead of x.y.z
>
> Signed-off-by: Anubhav Shelat <ashelat@redhat.com>
> ---
> rteval/modules/loads/kcompile.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
> index 35ee5cbbb52d..92442468febf 100644
> --- a/rteval/modules/loads/kcompile.py
> +++ b/rteval/modules/loads/kcompile.py
> @@ -175,7 +175,7 @@ class Kcompile(CommandLineLoad):
> if 'rc' in self._cfg.source:
> tarfile_prefix = re.search(r"\d{1,2}\.\d{1,3}\-[a-z]*\d{1,2}", self._cfg.source).group(0)
> else:
> - tarfile_prefix = re.search(r"\d{1,2}\.\d{1,3}\.*\d{1,2}", self._cfg.source).group(0)
> + tarfile_prefix = re.search(r"(\d{1,2}\.\d{1,3}\.\d{1,3})|(\d{1,2}\.\d{1,3})", self._cfg.source).group(0)
>
> # either a tar.xz or tar.gz might exist. Check for both.
> xz_file = os.path.join(self.srcdir,"linux-" + tarfile_prefix + ".tar.xz" )
> @@ -193,7 +193,7 @@ class Kcompile(CommandLineLoad):
> # find our source tarball
> if self._cfg.source:
> self.source = self._find_tarball()
> - kernel_prefix = re.search(r"linux-\d{1,2}\.\d{1,3}\.*\d{1,2}", self.source).group(0)
> + kernel_prefix = re.search(r"(linux-\d{1,2}\.\d{1,3}\.\d{1,3})|(linux-\d{1,2}\.\d{1,3})", self.source).group(0)
> else:
> tarfiles = glob.glob(os.path.join(self.srcdir, f"{DEFAULT_KERNEL_PREFIX}*"))
> if tarfiles:
> --
> 2.39.3
>
>
Signed-off-by: John Kacur <jkacur@redhat.com>
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 2/2] Edited code from previous commit to exclude try-except block
2023-06-30 17:10 ` [PATCH v3 2/2] Edited code from previous commit to exclude try-except block Anubhav Shelat
@ 2023-06-30 17:50 ` John Kacur
0 siblings, 0 replies; 4+ messages in thread
From: John Kacur @ 2023-06-30 17:50 UTC (permalink / raw)
To: Anubhav Shelat; +Cc: linux-rt-users, kcarcia
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-06-30 17:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-30 17:10 [PATCH 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 Anubhav Shelat
2023-06-30 17:10 ` [PATCH v3 2/2] Edited code from previous commit to exclude try-except block Anubhav Shelat
2023-06-30 17:50 ` John Kacur
2023-06-30 17:47 ` [PATCH 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 John Kacur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).