summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-10-12 20:36:34 +0000
committerrillig <rillig@pkgsrc.org>2006-10-12 20:36:34 +0000
commitf4a3dfca235d88530885212eaaa3e4c4c282f2a0 (patch)
tree4381ed24c25093bfa95e86cdbda16a07512992aa /mk
parent239e023acbd005134e2c6fc508e76c263917a1ef (diff)
downloadpkgsrc-f4a3dfca235d88530885212eaaa3e4c4c282f2a0.tar.gz
Warnings must only be prefixed by a warnings heading, not an error
heading.
Diffstat (limited to 'mk')
-rw-r--r--mk/configure/check-portability.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/mk/configure/check-portability.sh b/mk/configure/check-portability.sh
index 0c65dbb6b99..59c2ea785ae 100644
--- a/mk/configure/check-portability.sh
+++ b/mk/configure/check-portability.sh
@@ -1,4 +1,4 @@
-# $NetBSD: check-portability.sh,v 1.1 2006/10/12 17:57:05 rillig Exp $
+# $NetBSD: check-portability.sh,v 1.2 2006/10/12 20:36:34 rillig Exp $
#
# This program checks the extracted files for portability issues that
# are likely to result in false assumptions by the package.
@@ -15,6 +15,8 @@ set -eu
exitcode=0
+last_heading=""
+
error_msg() {
echo "ERROR: [check-portability.sh] $*" 1>&2
exitcode=1
@@ -24,15 +26,20 @@ warning_msg() {
echo "WARNING: [check-portability.sh] $*" 1>&2
}
-last_heading=""
-heading() {
-
+error_heading() {
if test "$1" != "$last_heading"; then
last_heading="$1"
error_msg "=> $1"
fi
}
+warning_heading() {
+ if test "$1" != "$last_heading"; then
+ last_heading="$1"
+ warning_msg "=> $1"
+ fi
+}
+
# usage: check_shell <fname>
check_shell() {
# See the end of the loop for the redirection.
@@ -56,7 +63,7 @@ check_shell() {
;;
*\$RANDOM*)
- heading "Found \$RANDOM:"
+ warning_heading "Found \$RANDOM:"
warning_msg "$fname: $line"
;;
esac
@@ -69,7 +76,7 @@ check_shell() {
case "$1" in
"test" | "[")
if [ "==" = "$3" ]; then
- heading "Found test ... == ...:"
+ error_heading "Found test ... == ...:"
error_msg "$fname: $line"
fi
;;