diff options
Diffstat (limited to 'sbolint')
-rwxr-xr-x | sbolint | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -1465,8 +1465,26 @@ sub check_script { $makepkg = $lineno; } elsif(/^\s*?CWD=/) { log_warning("$file:$lineno: lone CWD= assignment is redundant in 15.0 template"); - } elsif(/^\s*?chown\s+[^#;]*\S+\.\S+/) { - log_warning("$file:$lineno: chown should use : instead of . for user:group separator"); + } elsif(/^\s*?chown\s/) { + # explanation in english: get rid of any comment portion of the command, + # then if we (a) have no : character, and (b) have what looks like + # user.group or $user.$group, complain. + # if (a) is true but (b) isn't, that probably means the user:group is + # given together in one variable, and we can't really check that. + # that, or there's no user/group at all (e.g. chown's --reference + # option). + my $chown = $_; + $chown =~ s/#.*//; + if(($chown !~ /:/) && + ($chown =~ / + (?:\b|\$) # word boundary or $ (in case it's a variable) + \w[\w\d]+ # assume user or var starts with letter or _, and >=2 chars long + \. # a literal dot + [\w\$][\w\d]+ # user or var again + /x)) + { + log_warning("$file:$lineno: chown should use : instead of . for user:group separator"); + } } if(/^[^#]*<documentation>/) { |