apt-file is rubbish and super slow.
make a REST micro server to query content conveniently and have it backed by an actual decompressed database so its not super slow. currently considering bolt or mongo as database.
NB: this needs to be backed by an on-disk database as the archive.ubuntu contents is almost 2GiB of decompressed data
Each archive has a uniqueid
$ curl localhost:8080/v1/archives ["archive.neon.kde.org/user/dists/xenial","archive.ubuntu.com/ubuntu/dists/xenial"]
Using this id one can find contents in that archive
$ curl localhost:8080/v1/find/archive.neon.kde.org/user/dists/xenial\?q=\*KF5ConfigConfig.cmake {"usr/lib/x86_64-linux-gnu/cmake/KF5Config/KF5ConfigConfig.cmake":["libkf5config-dev"]}
Multiple ids can be grouped togeter into an ordered archive_pool
$ curl localhost:8080/v1/pools {"neon":["archive.neon.kde.org/user/dists/xenial","archive.ubuntu.com/ubuntu/dists/xenial"]}
For consideration
- may or may not be handy to query all supported archives? payload would have to be different though (i.e. /find/*?q=Foo.cmake). This would have to return a vastly more complicated payload though
- maybe allow a query list so one can query multiple files in one GET
- ability to upload one's sources.list and have the api return relevant archives (NB: with fragmented soruces in sourcs.list.d this becomes vastly more weird)