Commit 54f12284 authored by Leo's avatar Leo

feat(apkbuild-lint): implement invalid-option

parent 97671f1f
......@@ -72,6 +72,18 @@ cpanmakedepends
cpancheckdepends
HOSTCC" | tr '\n' '|')
valid_options="
archcheck
!archcheck
!check
checkroot
net
!strip
suid
!tracedeps
chmod-clean
"
default_builddir_value() {
[ "$SKIP_DEFAULT_BUILDDIR_VALUE" ] && return 0
[ "$SKIP_AL1" ] && return 0
......@@ -285,6 +297,16 @@ overwrite_xflags() {
sed "s/^\([^:]*:[^:]*:\)\(.*\)/SP:[AL36]:\1$1 should not be overwritten, add \$$1 to it/"
}
invalid_option() {
[ "$SKIP_INVALID_OPTION" ] && return 0
[ "$SKIP_AL49" ] && return 0
for i in $options; do
if ! echo "$valid_options" | grep -q -x "$i"; then
scan "options=.*$i" "invalid option '$i'" 'AL49' 'MC'
fi
done
}
ret=0
for apkbuild; do
if [ -f "$apkbuild" ]; then
......@@ -323,6 +345,7 @@ for apkbuild; do
overwrite_xflags "CXXFLAGS" &
overwrite_xflags "FFLAGS" &
overwrite_xflags "LDFLAGS" &
[ "$options" ] && invalid_option &
for phase in prepare build check package; do
superfluous_cd_builddir "$phase" &
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment