diff mbox series

[2/5] rteval: kcompile: Fix path lookups in _remove_build_dirs

Message ID 20240304211655.20174-3-crwood@redhat.com
State New
Headers show
Series rteval: Fixes and speedups | expand

Commit Message

Crystal Wood March 4, 2024, 9:16 p.m. UTC
- Use the actual source directory rather than the incorrect kernel* to
  match what the tarball generates
- Use glob to expand the node* wildcard
- Fix the incorrect variable name in the error message

Signed-off-by: Crystal Wood <crwood@redhat.com>
---
 rteval/modules/loads/kcompile.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

John Kacur March 28, 2024, 9:07 p.m. UTC | #1
On Mon, 4 Mar 2024, Crystal Wood wrote:

> - Use the actual source directory rather than the incorrect kernel* to
>   match what the tarball generates
> - Use glob to expand the node* wildcard
> - Fix the incorrect variable name in the error message
> 
> Signed-off-by: Crystal Wood <crwood@redhat.com>
> ---
>  rteval/modules/loads/kcompile.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
> index b606f7aad202..de1539986723 100644
> --- a/rteval/modules/loads/kcompile.py
> +++ b/rteval/modules/loads/kcompile.py
> @@ -145,12 +145,11 @@ class Kcompile(CommandLineLoad):
>              return
>          self._log(Log.DEBUG, f"removing kcompile directories in {self.builddir}")
>          null = os.open("/dev/null", os.O_RDWR)
> -        cmd = ["rm", "-rf", os.path.join(self.builddir, "kernel*"),
> -               os.path.join(self.builddir, "node*")]
> +        cmd = ["rm", "-rf", self.mydir, *glob.glob(os.path.join(self.builddir, 'node*'))]
>          ret = subprocess.call(cmd, stdin=null, stdout=null, stderr=null)
>          if ret:
>              raise rtevalRuntimeError(self, \
> -                f"error removing builddir ({self.buildir}) (ret={ret})")
> +                f"error removing builddir ({self.builddir}) (ret={ret})")
>  
>      def _find_tarball(self):
>         # If the user specifies the full kernel name, check if available
> -- 
> 2.43.0

Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
index b606f7aad202..de1539986723 100644
--- a/rteval/modules/loads/kcompile.py
+++ b/rteval/modules/loads/kcompile.py
@@ -145,12 +145,11 @@  class Kcompile(CommandLineLoad):
             return
         self._log(Log.DEBUG, f"removing kcompile directories in {self.builddir}")
         null = os.open("/dev/null", os.O_RDWR)
-        cmd = ["rm", "-rf", os.path.join(self.builddir, "kernel*"),
-               os.path.join(self.builddir, "node*")]
+        cmd = ["rm", "-rf", self.mydir, *glob.glob(os.path.join(self.builddir, 'node*'))]
         ret = subprocess.call(cmd, stdin=null, stdout=null, stderr=null)
         if ret:
             raise rtevalRuntimeError(self, \
-                f"error removing builddir ({self.buildir}) (ret={ret})")
+                f"error removing builddir ({self.builddir}) (ret={ret})")
 
     def _find_tarball(self):
        # If the user specifies the full kernel name, check if available