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

Re: lintian: r269 - in trunk: checks debian testset testset/foo++/debian



On Thu, May 13, 2004 at 04:01:34PM +0200, marc@marcbrockschmidt.de wrote:

(...)

> +# check that control is UTF-8 encoded
> +open ICONV, "env LANG=C iconv -f utf8 -t utf8 debfiles/control 2>&1 |"
> +	or fail("failure while checking encoding of control for $type package $pkg");
> +my $line = 1;
> +while (<ICONV>) {
> +	if (m/iconv: illegal input sequence at position \d+$/) {
> +		tag "debian-control-file-uses-obsolete-national-encoding", "at line $line";
> +		last;
> +    }
> +    $line++;
> +}
> +close ICONV;

Please try to not duplicate code. Previously that was
nearly-unavoidable, but now it can easily be avoided: add some function
like 'check_for_non_utf8' to lib/Util.pm, which accepts filename +
appropriate tag, and make sure all scripts using that check are 'use
Util', and invoke that function.

--Jeroen

-- 
Jeroen van Wolffelaar
Jeroen@wolffelaar.nl (also for Jabber & MSN; ICQ: 33944357)
http://Jeroen.A-Eskwadraat.nl



Reply to: