mirror of
https://github.com/systemd/systemd.git
synced 2025-02-02 13:47:27 +03:00
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.
This commit is contained in:
parent
227ef9bc38
commit
0bca795456
@ -36,6 +36,7 @@ OUTFILE_MODE = 0o775
|
||||
|
||||
OUTFILE_FUNCS = r"""
|
||||
import os, sys
|
||||
import shutil
|
||||
|
||||
def d(path, mode):
|
||||
os.mkdir(path, mode)
|
||||
@ -58,6 +59,8 @@ if not os.path.isdir(sys.argv[1]):
|
||||
|
||||
os.chdir(sys.argv[1])
|
||||
|
||||
if os.path.exists('sys'):
|
||||
shutil.rmtree('sys')
|
||||
"""
|
||||
|
||||
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user