forked from ALHP/ALHP.GO
followup fixes for new weighted build-queue
This commit is contained in:
18
rm_chroot.py
Normal file
18
rm_chroot.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
SAVE_PATH = "/path/to/workdir"
|
||||
|
||||
try:
|
||||
chroot_abs = Path(sys.argv[1]).resolve(True)
|
||||
except:
|
||||
print("path does not resolve")
|
||||
sys.exit(1)
|
||||
|
||||
if str(chroot_abs).startswith(SAVE_PATH):
|
||||
os.system("rm -rf " + str(chroot_abs))
|
||||
else:
|
||||
sys.exit(2)
|
Reference in New Issue
Block a user