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

Bug#243729: machine parseable version of lintian output



Stefano Zacchiroli <zack@debian.org> writes:

> Cool. One questions and one suggestion then:
>
> - question: is there already available reusable parsing code for that
>   format? If not I can hack up something to be embedded into
>   python-debian, as I presume the code can be useful to somebody else

There isn't parsing code in Python.  :)

It's a fairly trivial regex parse, which is done by the Lintian scripts
but not in a way that is very extractable (mostly because it's so trivial
that we've not bothered).

    next if $line /^N:/;
    next unless $line =~ /^([EWIXO]): (\S+)(?: (\S+))?: (\S+)(?:\s+(.*))?/;
    my ($code, $package, $type, $tag, $extra) = ($1, $2, $3, $4, $5);
    $type = 'binary' unless $type;

$type should be source, binary, or udeb.  $package is the name of the
package of that type, $tag is the tag, and $extra is any additional tag
data.  The $code will be E(rror), W(arning), I(nfo), (e)X(perimental), or
O(verridden).  Lines starting with N: are informational output that should
be ignored.

> - suggestion: please link the above URL from the Lintian website, so
>   that other people like me will avoid bothering you in the future with
>   this request :)

Will do.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: