Re: Bug#513663: [general] need infrastructure to check related packages
On Mon, January 10, 2011 09:51, Niels Thykier wrote:
> Alright, I need a second pair of eyes here. In frontend/lintian there
> is a piece of code[1]. This is about line 880ish in the infra-513663
> branch.
>
> I am almost certain there is something fishy going on within the if
> body. With a bit of "printf"-debugging I have concluded that $checks in
> "if ($check_tags) {" part is A) a scalar and B) undefined yet it is
> happily used as a hash!
Nope, this is a case of confusingly overloaded variable names. We have
my $action;
my $checks;
my $check_tags;
[...]
my %collection_info;
my %checks;
my %check_abbrev;
$checks is a scalar populated by --{dont-,}check-part, %checks is a hash
indicating which scripts from checks/ should be run. So $checks is the
former, $checks{foo} is an index in to the latter.
$check_tags and $checks are mutually exclusive, so on entry to that
section of code, $checks will indeed be undefined and %checks will be an
empty hash which is then populated by the foreach.
> The else-part looks just as fishy! It split $checks on /,/ (so it is
> used as a scalar again), yet it also happily uses $checks as a hash just
> a bit further down.
Same again. It splits $checks and then populates %checks.
> I am guessing that these $checks{...} maps should have been replaced by
> (something like) $check_info{...}->{'requested-tags'}. But I would like
> this confirmed.
%checks is a list of script names, not a list of tags, so I'm not sure I
follow here (although I may just need more coffee).
Regards,
Adam
Reply to: