SA Bugzilla – Bug 7497
Certain Language Specific Rule entries are breaking rule gen on the new box
Last modified: 2019-06-26 07:19:09 UTC
Thanks to Merijn van den Kroonenberg, he identified that the new box had some grep issues on a line on a long-standing rule in my sandbox that had multiple language definitions. Re: the grep issue, on older CentOS boxes, I would be looking for a LANG=en_US setting as one possible culprit. Any ideas where that might be on Ubuntu? For triage, I nuked the line: [kmcgrail@talon2 kmcgrail]$ svn commit -m 'Removing language specific descriptions which are not grepping properly on new box for masscheck' Sending 20_rules_to_sandbox.cf Transmitting file data . Committed revision 1813992. This worked but the underlying issue of why I had to do this remains and this ticket exists so we can revert the rule change.
The actual code causing the problem: ./masses/rule-update-score-gen/generate-new-scores.sh:202:grep -v ^score rules/72_active.cf > rules/72_active.cf-scoreless ./masses/rule-update-score-gen/generate-new-scores.sh:203:mv -f rules/72_active.cf-scoreless rules/72_active.cf basically all score lines are stripped from 72_active.cf Additionally I am wondering if those grep statements might be removed altogether, because right now they are not doing a thing, as all score statements in the 72_active.cf are commented out. I think this is done by the build/mkrules program. build/mkrules line 455: # comment "score" lines for sandbox rules (bug 5558) # use generated scores, though, if the rule is active if ($type eq 'score' && $issandbox && !($isscores && $active_rules->{$name})) { $orig =~ s/^/#/g; } But I don’t understand above code enough to be sure. To test or experiment with grep and special characters: wget http://sa-update.ena.com/1813258.tar.gz extract the 72_active.cf Then experiment with locale settings(eg. SET LANG=en_US) and run: grep -v ^score 72_active.cf > test.cf And test.cf should not end with the line: Binary file 72_active.cf matches
(In reply to Kevin A. McGrail from comment #0) > Re: the grep issue, on older CentOS boxes, I would be looking for a > LANG=en_US setting as one possible culprit. Any ideas where that might be > on Ubuntu? /etc/default/locale (or /etc/environment on older versions)
Merijn & Dave, is this resolved
So is the locale fixed?