Fixed bug in kcompile where run would fail if kcompile-source version had the form x.y instead of x.y.z
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
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 <[email protected]>
--- rteval/modules/loads/kcompile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
rteval/modules/loads/kcompile.py +2 -2
@@ -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:
Signature · 1 line
2.39.3
PATCH v3 2/2 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 exclude try-except block.
Signed-off-by Anubhav Shelat <[email protected]>
--- rteval-cmd | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
rteval-cmd +1 -5
@@ -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/"
Signature · 1 line
2.39.3
Re: [PATCH v3 2/2] Edited code from previous commit to exclude try-except block
Quoted 29 lines · 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 <[email protected]>--- rteval-cmd | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)rteval-cmd +1
-5@@ -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/"Signature · 1 line
2.39.3
- Modified comment
Signed-off-by John Kacur <[email protected]>
Quoted 34 lines · 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 <[email protected]>--- rteval/modules/loads/kcompile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)rteval/modules/loads/kcompile.py +2
-2@@ -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:Signature · 1 line
2.39.3
Signed-off-by John Kacur <[email protected]>
Thanks