Commit 20c24665 authored by Leo's avatar Leo

make double_underscore_in_variable more robust

parent 09e2cec3
......@@ -230,7 +230,13 @@ pkgname_used_in_source() {
double_underscore_in_variable() {
[ "$SKIP_DOUBLE_UNDERSCORE_IN_VARIABLE" ] && return 0
[ "$SKIP_AL30" ] && return 0
scan '(^|\t)(local ([A-Za-z_])?.*)?__.*(=)?' 'double underscore on variables are reserved' 'AL30' 'MC'
# Run this twice, once which will detect variables without the local keyword
# which requires matching the = sign at the end. The second time will match
# for variables declared with the local keyword which do not require the =
# sign
scan '(^|\t)?__[A-Za-z0-9_].*=' 'double underscore on variables are reserved' 'AL30' 'MC'
scan '(^|\t)local ([A-Za-z0-9_])?.*__[A-Za-z0-9_].*(=)?' 'double underscore on variables are reserved' 'AL30' 'MC'
}
}
_run_apkbuild_leo() {
......
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