public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <amikan@ilbers.de>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH] CI: Use shutil for file operations
Date: Tue, 16 Jan 2024 13:49:02 +0200	[thread overview]
Message-ID: <20240116114902.537283-1-amikan@ilbers.de> (raw)

Migrate to shutil to avoid overhead on process API.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 testsuite/cibuilder.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 2b784ef9..bb62bb8d 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -181,11 +181,12 @@ class CIBuilder(Test):
 
     def delete_from_build_dir(self, path):
         self.check_init()
-        process.run('rm -rf ' + self.build_dir + '/' + path, sudo=True)
+        shutil.rmtree(self.build_dir + '/' + path, True)
 
     def move_in_build_dir(self, src, dst):
         self.check_init()
-        process.run('mv ' + self.build_dir + '/' + src + ' ' + self.build_dir + '/' + dst, sudo=True)
+        if os.path.exists(self.build_dir + '/' + src):
+            shutil.move(self.build_dir + '/' + src, self.build_dir + '/' + dst)
 
     def bitbake(self, target, bitbake_cmd=None, **kwargs):
         self.check_init()
-- 
2.34.1


             reply	other threads:[~2024-01-16 11:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16 11:49 Anton Mikanovich [this message]
2024-01-23  9:11 ` Uladzimir Bely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116114902.537283-1-amikan@ilbers.de \
    --to=amikan@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox