diff options
-rwxr-xr-x | scripts/main_loop.py | 21 | ||||
-rwxr-xr-x | scripts/reset.py | 24 |
2 files changed, 25 insertions, 20 deletions
diff --git a/scripts/main_loop.py b/scripts/main_loop.py index e9eb4ba..cacf349 100755 --- a/scripts/main_loop.py +++ b/scripts/main_loop.py @@ -68,22 +68,6 @@ def step(): print("-- Linux built") phase.set(2) -def rm_rf(d): - for path in (os.path.join(d,f) for f in os.listdir(d)): - if os.path.isdir(path): - rm_rf(path) - else: - os.unlink(path) - os.rmdir(d) - -# TODO repair, broken -def reset(): - rm_rf(conf.build_folder) - os.chdir(conf.linux_sources) - subprocess.call(['make','clean']) - os.rm('.config') # remove linux config file - - class mainThread(Thread): def __init__(self, name): Thread.__init__(self, name=name) @@ -112,7 +96,4 @@ def main_loop(): if __name__ == '__main__': signal.signal(signal.SIGTERM, sigterm_handler) - if sys.argv[1] == "reset": - reset() - else: - main_loop() + main_loop() diff --git a/scripts/reset.py b/scripts/reset.py new file mode 100755 index 0000000..461bbda --- /dev/null +++ b/scripts/reset.py @@ -0,0 +1,24 @@ +#!/bin/python3 +import os +import sys + +def rm_rf(d): + for path in (os.path.join(d,f) for f in os.listdir(d)): + if os.path.isdir(path): + rm_rf(path) + else: + os.unlink(path) + os.rmdir(d) + +# TODO repair, broken +def reset(): + rm_rf(conf.build_folder) + os.chdir(conf.linux_sources) + subprocess.call(['make','clean']) + os.rm('.config') # remove linux config file + + +################################################################################# + +if __name__ == '__main__': + reset() |