From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Michael Olbrich <m.olbrich@pengutronix.de>,
Mircea Ciocan <m.ciocan@ppc-ag.de>
Subject: [ptxdist] [PATCH] ptxd_lib_dopermissions: use 'set -e' instead of &&
Date: Fri, 29 May 2020 13:03:56 +0200 [thread overview]
Message-ID: <20200529110356.30302-1-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20200529092129.GH31789@pengutronix.de>
It seems that some bash versions cannot handle very long '&&' lists.
So in this case, just use 'set -e' to abort on error.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
Hi,
So I ended up with just using 'set -e'. The other stuff is a bit more
complex and I need to figure out what exactly I want to do here.
Does this work for you?
Michael
scripts/lib/ptxd_lib_dopermissions.awk | 13 +++++++++----
scripts/lib/ptxd_make_image_prepare_work_dir.sh | 1 -
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/scripts/lib/ptxd_lib_dopermissions.awk b/scripts/lib/ptxd_lib_dopermissions.awk
index b0aefe1b7a18..bef1823317c5 100755
--- a/scripts/lib/ptxd_lib_dopermissions.awk
+++ b/scripts/lib/ptxd_lib_dopermissions.awk
@@ -2,18 +2,23 @@
BEGIN {
FS = "\x1F";
+ print("set -e")
}
$1 ~ "f" {
- printf("chmod %s '.%s' &&\n" \
- "chown %s.%s '.%s' &&\n", \
+ printf("chmod %s '.%s'\n" \
+ "chown %s.%s '.%s'\n", \
$5, $2, $3, $4, $2);
}
$1 ~ "n" {
printf("if [ ! \\( -b '.%s' -o -c '.%s' -o -p '.%s' \\) ]; then " \
- " mknod -m %s '.%s' %s %s %s &&\n" \
+ " mknod -m %s '.%s' %s %s %s\n" \
" chown %s.%s '.%s'\n" \
- "fi &&\n", \
+ "fi\n", \
$2, $2, $2, $5, $2, $6, $7, $8, $3, $4, $2);
}
+
+END {
+ print("set +e")
+}
diff --git a/scripts/lib/ptxd_make_image_prepare_work_dir.sh b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
index 8b08397653ab..adbf7797c1b4 100644
--- a/scripts/lib/ptxd_make_image_prepare_work_dir.sh
+++ b/scripts/lib/ptxd_make_image_prepare_work_dir.sh
@@ -52,7 +52,6 @@ ${list[*]}
{
echo "cd '${work_dir}' || exit"
ptxd_dopermissions "${ptxd_reply_perm_files[@]}"
- echo ":"
} | sh &&
check_pipe_status &&
--
2.20.1
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
prev parent reply other threads:[~2020-05-29 11:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 13:36 [ptxdist] Segmentation fault with ptxdist-2020.05.0 Mircea Ciocan
2020-05-15 7:40 ` Mircea Ciocan
2020-05-15 7:48 ` Michael Olbrich
2020-05-15 7:59 ` Alexander Dahl
2020-05-15 8:07 ` Mircea Ciocan
2020-05-15 7:46 ` Michael Olbrich
2020-05-15 13:02 ` Mircea Ciocan
2020-05-15 13:36 ` Mircea Ciocan
2020-05-29 9:21 ` Michael Olbrich
2020-05-29 11:03 ` Michael Olbrich [this message]
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=20200529110356.30302-1-m.olbrich@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=m.ciocan@ppc-ag.de \
--cc=ptxdist@pengutronix.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