summaryrefslogtreecommitdiff
path: root/test/sys-script.py
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-09-29 12:28:25 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-09-29 12:28:25 +0200
commit0bca795456f64bd29285a32abb2d3674e12923df (patch)
tree5b3b6c6ba398dfdf4220cc05542fe0c54145863d /test/sys-script.py
parent227ef9bc38804b04620420f57226246fab1a0a9c (diff)
downloadsystemd-0bca795456f64bd29285a32abb2d3674e12923df.tar.gz
sys-script: remove output directory if it exists
meson will occasionally call us even though the output directory exists. Let's just nuke and recreate in that case.
Diffstat (limited to 'test/sys-script.py')
-rwxr-xr-xtest/sys-script.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/sys-script.py b/test/sys-script.py
index ac1369735b..2de7d7ea30 100755
--- a/test/sys-script.py
+++ b/test/sys-script.py
@@ -20,6 +20,7 @@
#
import os, sys
+import shutil
def d(path, mode):
os.mkdir(path, mode)
@@ -40,6 +41,8 @@ if not os.path.isdir(sys.argv[1]):
os.chdir(sys.argv[1])
+if os.path.exists('sys'):
+ shutil.rmtree('sys')
d('sys', 0o755)
d('sys/kernel', 0o775)
f('sys/kernel/kexec_crash_loaded', 0o664, b'0\n')