Quoting Otto Kekäläinen (2024-08-19 03:45:37)
> I tried to use codesearch.debian.net to find out how many packages have a
> debian/gbp.conf but it seems it can't be used to simply list packages that
> have a specific file, it always also needs a search terms to look up inside
> the file.
> 
> With 
> https://codesearch.debian.net/search?q=path%3Adebian%2Fgbp.conf+debian-branch+%3F%3D+%3Fdebian%2Flatest&literal=0
> I was able to find that 1655 packages have either "debian-branch =
> debian/latest" or "debian-branch=debian/latest".
> 
> Is there some easy way to iterate every single Debian package and
> extract just one single file from them without having to download all
> packages?
> 
> I'd like to see how many % of all Debian packages have a gbp.conf file, and
> then download all of them to do stats on what they contain.

finding out which package contains a given file is better done via the Contents
files from our mirrors. The apt-file tool provides an easy interface to search
these contents files and answer the question "which package contains a file or
path that looks like this".

By default, apt-file will only download (and search) Contents files for binary
packages and not source packages. To change that, edit
/etc/apt/apt.conf.d/50apt-file.conf and change DefaultEnabled from "false" to
"true" in the section deb-src::Contents-dsc. Once that is done you run "apt
update" to download the newly enabled Contents files and then you can run a
search like this:

    $ apt-file --index-names dsc search debian/gbp.conf

You need to add --index-names because the default value is "deb" and that would
only search through binary packages.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to