diff options
author | Karel Kočí <cynerd@email.cz> | 2015-03-22 23:56:22 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2015-03-22 23:56:22 +0100 |
commit | 63bc217e9c13e295cc8e7df89dad0a14d29cb5b8 (patch) | |
tree | b8a9a1d0ac30b3b097ab05d96ab6c7d39268c23a /scripts | |
parent | 06964eb595a2362ecc9cd542f72c14cb6d49bf1b (diff) | |
download | linux-conf-perf-63bc217e9c13e295cc8e7df89dad0a14d29cb5b8.tar.gz linux-conf-perf-63bc217e9c13e295cc8e7df89dad0a14d29cb5b8.tar.bz2 linux-conf-perf-63bc217e9c13e295cc8e7df89dad0a14d29cb5b8.zip |
Try to repair reset functionality
Build folder is not removed.
But this is not fundamental.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/main_loop.py | 18 |
1 files changed, 14 insertions, 4 deletions
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() |