SA Bugzilla – Bug 5049
[review] sa-update should allow comments in channelfiles
Last modified: 2006-08-22 16:31:29 UTC
sa-update should allow for comments in channelfiles. The same goes for gpgkeyfiles. I assume, but haven't checked, that comments aren't supported in that file either.
Created attachment 3653 [details] suggested patch
+1
Sending sa-update.raw Transmitting file data . Committed revision 433045.
Created attachment 3662 [details] alternative patch sorry, still way behind having to run my friend's theatre chain... The committed patch doesn't handle blank lines, leading whitespace, or commments at the end of a line. This patch handles the above, but doesn't deal with someone wanting a # to be included. I can't think of a reason why you'd need it though, so I didn't bother supporting something like \# as we do with other config files.
reopening
I agree with that +1
well, since you've done it: +1
I'm -0.5. The RE being used is a bit confusing: s/\s*(?:#.*)?//g why not: s/\s*\#.*$// The first RE seems questionable, since for instance, it'll always match on every string (though it may not actually do anything). Also: + next unless $key; # skip blank lines (that remain) would then have to change to: next if ($key =~ /^\s*$/); or next unless ($key =~ /\S/);
Created attachment 3664 [details] better patch Fair enough. Your alternative isn't workable, though, since it doesn't handle leading whitespace and trailing whitespace in the absence of a comment on the line. How about we just do what we do in Parser.pm, except leave out support for hashes since they'll never be needed/aren't valid. This patch also fixes the channel validation (if one wasn't valid, the next one wasn't checked). It also dbg's that a channel isn't valid and is being skipped.
That looks a lot clearer to me. +1 unless someone jumps in with a yet cleaner version.
sure, +1
[dos@FC5-VPC 3.1]$ svn ci -m "bug 5049: handle comments and whitespace in sa-update config files and fix an error in channel name validation" Sending sa-update.raw Transmitting file data . Committed revision 433797. [dos@FC5-VPC trunk]$ svn ci -m "bug 5049: handle comments and whitespace in sa-update config files and fix an error in channel name validation" Sending sa-update.raw Transmitting file data . Committed revision 433798. [dos@FC5-VPC trunk]$