Import the latest version upstream

This commit is contained in:
Pierre Pronchery 2019-06-29 01:20:14 +02:00
parent 68e90f8049
commit e7c887d6d5

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
#$Id$ #$Id$
#Copyright (c) 2016-2017 Pierre Pronchery <khorben@defora.org> #Copyright (c) 2016-2019 Pierre Pronchery <khorben@defora.org>
# #
#Redistribution and use in source and binary forms, with or without #Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met: #modification, are permitted provided that the following conditions are met:
@ -33,6 +33,7 @@ PROJECTCONF="../project.conf"
DATE="date" DATE="date"
DEBUG="_debug" DEBUG="_debug"
FIND="find" FIND="find"
GREP="grep"
LINT="lint -g" LINT="lint -g"
SORT="sort -n" SORT="sort -n"
TR="tr" TR="tr"
@ -59,25 +60,50 @@ _clint()
done < "$PROJECTCONF" done < "$PROJECTCONF"
for subdir in $subdirs; do for subdir in $subdirs; do
[ -d "../$subdir" ] || continue [ -d "../$subdir" ] || continue
for filename in $($FIND "../$subdir" -name '*.c' | $SORT); do for filename in $($FIND "../$subdir" -type f | $SORT); do
_clint_file "$filename" case "$filename" in
if [ $? -eq 0 ]; then *.c)
echo "$filename:" echo
else (_clint_lint "$filename";
_clint_rtrim "$filename")
;;
*.h)
echo
echo "$filename:"
(_clint_rtrim "$filename")
;;
*)
continue
;;
esac
if [ $? -ne 0 ]; then
echo "FAIL"
echo "$PROGNAME: $filename: FAIL" 1>&2 echo "$PROGNAME: $filename: FAIL" 1>&2
ret=2 ret=2
else
echo "OK"
fi fi
done done
done done
return $ret return $ret
} }
_clint_file() _clint_lint()
{ {
echo filename="$1"
echo -n "${filename%/*}/"
$DEBUG $LINT $CPPFLAGS $CFLAGS "$filename" 2>&1 $DEBUG $LINT $CPPFLAGS $CFLAGS "$filename" 2>&1
} }
_clint_rtrim()
{
filename="$1"
regex="[ ]\\+\$"
$DEBUG $GREP -vq "$regex" "$filename" 2>&1
}
#debug #debug
_debug() _debug()
@ -118,7 +144,7 @@ while getopts "cO:P:" name; do
export "${OPTARG%%=*}"="${OPTARG#*=}" export "${OPTARG%%=*}"="${OPTARG#*=}"
;; ;;
P) P)
#XXX ignored for compatibility CPPFLAGS="$CPPFLAGS -I$OPTARG/include"
;; ;;
?) ?)
_usage _usage