]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
tools/genboardscfg.py: wait for unfinished subprocesses before error-out
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Mon, 25 Aug 2014 03:39:45 +0000 (12:39 +0900)
committerTom Rini <trini@ti.com>
Thu, 28 Aug 2014 21:18:48 +0000 (17:18 -0400)
When an error occurs or the program is terminated by the user
on the way, the destructer __del__ of class Slot is invoked and
the work directories are removed.

We have to make sure there are no subprocesses (in this case,
"make O=<work_dir> ...") using the work directories before
removing them.  Otherwise the subprocess spits a bunch of error
messages possibly causing more problems.  Perhaps some users
may get upset to see too many error messages.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
tools/genboardscfg.py

index 1406acd46f87efb15837d0e81b43f77e7ab0412c..a0df7058b15b3e8b98e2c65d7df63c969696eff2 100755 (executable)
@@ -276,6 +276,9 @@ class Slot:
 
     def __del__(self):
         """Delete the working directory"""
+        if not self.occupied:
+            while self.ps.poll() == None:
+                pass
         shutil.rmtree(self.build_dir)
 
     def add(self, defconfig):