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

Re: Entries in Packages files that lack a Source field

Antti-Juhani Kaijanaho wrote:
As you probably know, entries in the Packages file only have a Source
field if the name of the source package is different from the name of
the binary package being described.
Why not add a patch to grep-dctrl instead?
What patch would that be?

Something equivalent to:

  cat /var/lib/dpkg/available |
    awk '/^Package:/ {P=$2;V=""}
         /^Version:/ {if (V=="") { V=$2; } }
         /^Source: .* (.*)/ {V=substr($3,2,length($3)-2)}
         /^Source:/ {P=$2}
         /^$/ { print "Source-Package:", P; print "Source-Version:", V }

I would've thought. (That adds "Source-Package:" and "Source-Version:" fields to every stanza)

The idea being that "grep-available --source-info [...]" would work the same as piping the above into "| grep-ctrl [...]".


Reply to: