[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Lintian::Collect - index vs file_info and the rest



Hi,

I have noticed a mismatch between (sorted_)index and a lot of the other
Lintian::Collect methods (such as file_info).  This is a pain because it
can give "uninitialized variable" warnings when you do:

foreach my $file (@{$info->sorted_index}) {
    [...]
    next unless $info->file_info->{$file} =~ m/\bELF\b/o;
    [...]
}


The two differences I can tell are:
 * Whether directories ends with a "/"
   - They always do with index; they don't with file_info
 * "special characters"
   - index seems to "more quoted" than other methods.
     (i.e. "'\\ " vs "'\ " and with \ddd sequences)

The first one should be fairly trivial, the second one could be
difficult to deal with.

We lose the quote in (i.e.) collection/file-info when we pass the
filename to (xargs) file; restoring the quote seems to be non-trivial
(quotemeta cannot be used).
  We can unquote the names in index rather trivially (we already do that
a couple of times), but I am not certain that is the "right thing" to do.

On a related note, it appears that only "filenames" from the legacy test
suite has filenames "funny enough" to trigger issues with the quoting.
So if you want to play with this, please be sure to use that test.

~Niels


Reply to: