mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-25 19:21:35 +01:00
userland: move more userland/arch/ logic into property tree
This commit is contained in:
@@ -180,6 +180,14 @@ class ShellHelpers:
|
||||
f.write(cmd_string)
|
||||
self.chmod(cmd_file)
|
||||
|
||||
def rmrf(self, path):
|
||||
self.print_cmd(['rm', '-r', '-f', path, LF])
|
||||
if not self.dry_run and os.path.exists(path):
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
os.unlink(path)
|
||||
|
||||
def run_cmd(
|
||||
self,
|
||||
cmd,
|
||||
@@ -309,14 +317,6 @@ class ShellHelpers:
|
||||
else:
|
||||
return [x for x in cmd if x != LF]
|
||||
|
||||
def rmrf(self, path):
|
||||
self.print_cmd(['rm', '-r', '-f', path, LF])
|
||||
if not self.dry_run and os.path.exists(path):
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
else:
|
||||
os.unlink(path)
|
||||
|
||||
def walk(self, root):
|
||||
'''
|
||||
Extended walk that can take files or directories.
|
||||
|
||||
Reference in New Issue
Block a user