From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 1/3] Exit if commands fail under flock
Date: Sun, 12 Aug 2018 10:33:36 +0200 [thread overview]
Message-ID: <c2328e791cb1ec8c9018bd49e07e1ddc2f93462e.1534062818.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1534062818.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1534062818.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
Add set -e to the shells spawned by flock so that any failure of a
command will lead to an immediate termination and reporting of the
failure. E.g., do_bootstrap could have silently failed so far.
Derived from patch by Maxim Osipov.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/dpkg-base.bbclass | 1 +
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 1 +
2 files changed, 2 insertions(+)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 674c0b5..9b42c42 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -63,6 +63,7 @@ do_build() {
sudo mount --bind ${WORKDIR} ${BUILDROOT}
sudo flock ${MOUNT_LOCKFILE} -c ' \
+ set -e
if ! grep -q ${BUILDCHROOT_DIR}/isar-apt /proc/mounts; then \
mount --bind ${DEPLOY_DIR_APT}/${DISTRO} ${BUILDCHROOT_DIR}/isar-apt; \
mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads; \
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 8afd470..5fba3dd 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -172,6 +172,7 @@ isar_bootstrap() {
shift
done
sudo flock "${ISAR_BOOTSTRAP_LOCK}" -c "\
+ set -e
if [ ! -e "${DEPLOY_ISAR_BOOTSTRAP}" ]; then
if [ -e "${ROOTFSDIR}" ]; then
sudo umount -l "${ROOTFSDIR}/dev" || true
--
2.16.4
next prev parent reply other threads:[~2018-08-12 8:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-12 8:33 [PATCH 0/3] Fail under flock & cleanups Jan Kiszka
2018-08-12 8:33 ` Jan Kiszka [this message]
2018-08-12 8:33 ` [PATCH 2/3] isar-bootstrap: Remove redundant sudos Jan Kiszka
2018-08-12 8:33 ` [PATCH 3/3] dpkg-base: Reformat flock-protected commands Jan Kiszka
2018-08-13 8:35 ` [PATCH 0/3] Fail under flock & cleanups Henning Schild
2018-08-14 10:31 ` Maxim Yu. Osipov
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=c2328e791cb1ec8c9018bd49e07e1ddc2f93462e.1534062818.git.jan.kiszka@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=isar-users@googlegroups.com \
/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