diff options
author | rillig <rillig> | 2006-10-12 20:36:34 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-10-12 20:36:34 +0000 |
commit | a0aebf5246744491d652d2f703a79586d096fa81 (patch) | |
tree | 4381ed24c25093bfa95e86cdbda16a07512992aa /mk/configure | |
parent | a205d3bfd05964c5d5f34a0bd4d468399ab42655 (diff) | |
download | pkgsrc-a0aebf5246744491d652d2f703a79586d096fa81.tar.gz |
Warnings must only be prefixed by a warnings heading, not an error
heading.
Diffstat (limited to 'mk/configure')
-rw-r--r-- | mk/configure/check-portability.sh | 19 |
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 ;; |