From 63bc217e9c13e295cc8e7df89dad0a14d29cb5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 22 Mar 2015 23:56:22 +0100 Subject: Try to repair reset functionality Build folder is not removed. But this is not fundamental. --- scripts/main_loop.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/main_loop.py b/scripts/main_loop.py index 458085e..e9eb4ba 100755 --- a/scripts/main_loop.py +++ b/scripts/main_loop.py @@ -68,9 +68,17 @@ def step(): print("-- Linux built") phase.set(2) -# TODO repair, not working +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(): - os.rmdir(conf.build_folder) + rm_rf(conf.build_folder) os.chdir(conf.linux_sources) subprocess.call(['make','clean']) os.rm('.config') # remove linux config file @@ -103,6 +111,8 @@ def main_loop(): ################################################################################# if __name__ == '__main__': - print("Start") signal.signal(signal.SIGTERM, sigterm_handler) - main_loop() + if sys.argv[1] == "reset": + reset() + else: + main_loop() -- cgit v1.2.3