aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Mingrone <jrm@FreeBSD.org>2021-07-17 15:55:13 +0000
committerJoseph Mingrone <jrm@FreeBSD.org>2021-11-19 21:13:26 +0000
commit6ff48ecff7f5a179e16ee4aaf6e7affac69bb93e (patch)
treeeb5c2301a31c84533ce0630660192b193dd5120c
parent8e05a6e24d0476e5603bb3f2c2d3bc54c49a94b9 (diff)
downloadports-6ff48ecff7f5a179e16ee4aaf6e7affac69bb93e.tar.gz
ports-6ff48ecff7f5a179e16ee4aaf6e7affac69bb93e.zip
Mk/Scripts/qa.sh: Turn off pipefail when piping to grep -q
The pipeline readelf -d "${dep_file}" | grep -q SONAME can fail because grep -q closes the output early resulting sigpipe being sent to readelf. Other possible solutions are to turn off pipefail for the file or remove the -q grep argument. Credit to ashish@ for the detective work to discover the root cause of this. Differential Revision: https://reviews.freebsd.org/D31211 Reviewed by: emaste Approved by: bapt (portmgr) mat (portmgr)
-rw-r--r--Mk/Scripts/qa.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index 13548ddb38c7..9caf01581b47 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -663,9 +663,13 @@ proxydeps() {
# Check that the .so we need has a SONAME
if [ "${dep_file_pkg}" != "${PKGORIGIN}" ]; then
+ # When grep -q finds a match it will close the pipe immediately.
+ # This may cause the test to fail when pipefail is turned on.
+ set +o pipefail
if ! readelf -d "${dep_file}" | grep -q SONAME; then
err "${file} is linked to ${dep_file} which does not have a SONAME. ${dep_file_pkg} needs to be fixed."
fi
+ set -o pipefail
fi
# If we don't already depend on it, and we don't provide it