summaryrefslogtreecommitdiff
path: root/scripts/image_signing/ensure_not_tainted_license.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/image_signing/ensure_not_tainted_license.sh')
-rwxr-xr-xscripts/image_signing/ensure_not_tainted_license.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/image_signing/ensure_not_tainted_license.sh b/scripts/image_signing/ensure_not_tainted_license.sh
index daa00b55..7eab1c9a 100755
--- a/scripts/image_signing/ensure_not_tainted_license.sh
+++ b/scripts/image_signing/ensure_not_tainted_license.sh
@@ -48,7 +48,10 @@ main() {
fi
tainted_tag="<!-- tainted -->"
- tainted_status=$(grep "${tainted_tag}" "${license}")
+ # Add "|| :" to the grep command to prevent it from returning error code 1 if
+ # no match is found, which would cause the script to exit immediately with
+ # error code 1 due to set -e.
+ tainted_status=$(grep "${tainted_tag}" "${license}") || :
if [[ -n "${tainted_status}" ]]; then
echo "${license}:"
echo "License file contains packages with LICENSE=TAINTED."
@@ -61,6 +64,7 @@ main() {
/^[[:space:]]*$/d
p
}' "${license}"
+ exit 1
fi
exit 0
}