From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Michael Olbrich Date: Fri, 29 May 2020 13:03:56 +0200 Message-Id: <20200529110356.30302-1-m.olbrich@pengutronix.de> In-Reply-To: <20200529092129.GH31789@pengutronix.de> References: <20200529092129.GH31789@pengutronix.de> MIME-Version: 1.0 Subject: [ptxdist] [PATCH] ptxd_lib_dopermissions: use 'set -e' instead of && List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Michael Olbrich , Mircea Ciocan 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 --- 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