Merge pull request #495 from fosslinux/set-pipefail

Set pipefail when supported
This commit is contained in:
Samuel Tyler 2025-02-03 15:30:43 +11:00 committed by GitHub
commit 736d7967fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 6 additions and 7 deletions

View file

@ -1 +1 @@
1dbbcc42b293cdf558730a5c7e084422879b607bf14f42aa2168b0c8ebb2f2c1 script-generator e1c9bbedd2aca20b10568c1303e2227e0d68f36bb8f1dfd6ac39e14342f3a9f7 script-generator

View file

@ -410,7 +410,7 @@ FILE *start_script(int id, int bash_build) {
fputs("#!/bin/bash\n", out); fputs("#!/bin/bash\n", out);
if (strcmp(get_var("INTERACTIVE"), "True") == 0) { if (strcmp(get_var("INTERACTIVE"), "True") == 0) {
if (bash_build != 1) { if (bash_build != 1) {
fputs("set -E\ntrap 'env PS1=\"[TRAP] \\w # \" bash -i' ERR\n", out); fputs("set -eEo pipefail\ntrap 'env PS1=\"[TRAP] \\w # \" bash -i' ERR\n", out);
} else { } else {
/* FIXME early bash has buggy ERR trap handling */ /* FIXME early bash has buggy ERR trap handling */
fputs("set -e\ntrap 'bash -c '\"'\"'while true; do printf \"" fputs("set -e\ntrap 'bash -c '\"'\"'while true; do printf \""

View file

@ -1 +1 @@
0cd30eb7753ae8907fed32e52af9219d115aa60d6333b48097d00f76d85a5d67 script-generator ce952506148ebbd1d856e5f4d15be66b8292d2116f03861eb404420f75d2e7ce script-generator

View file

@ -1 +1 @@
572e849582ec2b79c768c7e8c61806141b3cd18ff1777e26433f12a2c92f093d script-generator 408442c1694654f3131246b99de4b66a5796077ffb59629039a321b1b973c938 script-generator

View file

@ -139,6 +139,8 @@ uninstall() {
if [ -z "$(ls -A "/${file}")" ]; then if [ -z "$(ls -A "/${file}")" ]; then
rmdir "/${file}" rmdir "/${file}"
fi fi
elif [ -h "${file}" ]; then
symlinks="${symlinks} ${file}"
else else
# in some cases we might be uninstalling a file that has already been overwritten # in some cases we might be uninstalling a file that has already been overwritten
# in this case we don't want to remove it # in this case we don't want to remove it
@ -147,9 +149,6 @@ uninstall() {
if [ "${in_fs}" = "${in_pkg}" ]; then if [ "${in_fs}" = "${in_pkg}" ]; then
rm -f "/${file}" rm -f "/${file}"
fi fi
if [ -h "${file}" ]; then
symlinks="${symlinks} ${file}"
fi
fi fi
done < ../filelist done < ../filelist
rm -f ../filelist rm -f ../filelist