U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 4/7] tools/genboardscfg.py: wait for unfinished subprocesses before error-out
Date: Mon, 25 Aug 2014 12:39:45 +0900	[thread overview]
Message-ID: <1408937988-19923-5-git-send-email-yamada.m@jp.panasonic.com> (raw)
In-Reply-To: <1408937988-19923-1-git-send-email-yamada.m@jp.panasonic.com>

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>
---

Changes in v3: None
Changes in v2: None

 tools/genboardscfg.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
index 722b316..67d450f 100755
--- a/tools/genboardscfg.py
+++ b/tools/genboardscfg.py
@@ -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):
-- 
1.9.1

  parent reply	other threads:[~2014-08-25  3:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-25  3:39 [U-Boot] [PATCH v3 0/7] tools/genboardscfg.py: various fixes and performance improvement Masahiro Yamada
2014-08-25  3:39 ` [U-Boot] [PATCH v3 1/7] tools/genboardscfg.py: ignore defconfigs starting with a dot Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, v3, " Tom Rini
2014-08-25  3:39 ` [U-Boot] [PATCH v3 2/7] tools/genboardscfg.py: be tolerant of missing MAINTAINERS Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, v3, " Tom Rini
2014-08-25  3:39 ` [U-Boot] [PATCH v3 3/7] tools/genboardscfg.py: be tolerant of insane Kconfig Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, v3, " Tom Rini
2014-08-25  3:39 ` Masahiro Yamada [this message]
2014-08-29 14:41   ` [U-Boot] [U-Boot, v3, 4/7] tools/genboardscfg.py: wait for unfinished subprocesses before error-out Tom Rini
2014-08-25  3:39 ` [U-Boot] [PATCH v3 5/7] tools/genboardscfg.py: fix minor problems on termination Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, v3, " Tom Rini
2014-08-25  3:39 ` [U-Boot] [PATCH v3 6/7] tools/genboardscfg.py: check if the boards.cfg is up to date Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, v3, " Tom Rini
2014-08-25  3:39 ` [U-Boot] [PATCH v3 7/7] tools/genboardscfg.py: improve performance Masahiro Yamada
2014-08-29 14:41   ` [U-Boot] [U-Boot, v3, " Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408937988-19923-5-git-send-email-yamada.m@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox