summaryrefslogtreecommitdiff
path: root/mk/check
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2020-03-11 22:30:59 +0000
committerrillig <rillig@pkgsrc.org>2020-03-11 22:30:59 +0000
commitf2946533cda77a661e0ce8e213640b6dbabefe34 (patch)
treeb9ddaebb201948202fce2a8aea17ecb35c20c1c9 /mk/check
parentd48f4c9f50612ff6cc26851a45790ca892a3cf98 (diff)
downloadpkgsrc-f2946533cda77a661e0ce8e213640b6dbabefe34.tar.gz
mk/check: reduce running time of portability check
Since several years, the portability check only checks for shell files. Instead of opening each extracted file to see whether it is a shell file, it is more efficient to filter the files based on their names. This saves a few system calls and in the case of lang/gcc9, half of the total running time. The file extensions to be excluded from the check have been sorted by their count in the PLISTs. This data does not accurately represent the source files of the package, but it's better than nothing.
Diffstat (limited to 'mk/check')
-rw-r--r--mk/check/check-portability.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/mk/check/check-portability.sh b/mk/check/check-portability.sh
index 8604fef832d..3ef255887e0 100644
--- a/mk/check/check-portability.sh
+++ b/mk/check/check-portability.sh
@@ -1,4 +1,4 @@
-# $NetBSD: check-portability.sh,v 1.11 2020/03/11 19:21:00 rillig Exp $
+# $NetBSD: check-portability.sh,v 1.12 2020/03/11 22:30:59 rillig Exp $
#
# This program checks all files in the current directory and any
# subdirectories for portability issues that are likely to result in
@@ -43,6 +43,16 @@ find * -type f -print 2>/dev/null \
eval "case \"\$fname\" in $SKIP_FILTER *.orig) skip=yes;; esac"
[ $skip = no ] || continue
+ ext="${fname##*.}"
+ case "$ext" in
+ # echo */*/PLIST | xargs cat | sed s,'.*\.',, | sort | uniq -c | sort -nr | sed 40q
+ (png|html|svg|py|h|mo|php|js|xml|rb|go|txt|3|hpp) continue ;;
+ (tfm|gif|dtd|properties|json|ogg|gz|test|result|xpm|po) continue ;;
+ (page|1|kicad_mod|hxx|jpg|css|el|htm|a|docbook|vf|inc) continue ;;
+ # other source files:
+ (c|C|cc|cxx|f|go|pl|py|in|ac|m4) continue ;;
+ esac
+
case "$opsys" in
SunOS-5.9)
# See also (if you can):