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

Lintian: Using tied handles



Hi,

I have been looking a bit at compressing the copyright file.  Currently,
we need to read the copyright file twice in checks/copyright-file.  Once
for checking the encoding and once for all our other checks.  While a
bit wasteful, it works well and is trivial.

I have created a branch at [1] that shows how we /could/ use tied
handles to do a onetime pass, even with compressed files.  This could be
reused for other places where we check that files are UTF-8 encoded (as
long as we read the entire file[2]).

The downside is that this solution is more complex - mostly because we
have "two" consumers of the same stream and they do not necessarily
share the same "ideal" input record separator ($/).

Alternatively, we can "keep it simple" and just open the stream twice
like we currently do.

~Niels

[1]
http://anonscm.debian.org/gitweb/?p=users/nthykier/lintian.git;a=shortlog;h=refs/heads/tied-handles

[2] checks/menus and checks/control-file should be able to benefit from
this as well.  Not so sure about checks/changelog-file.


Reply to: