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

Re: Is distro-tracker accessible by some sort of API?



Hi Roberto

> does source package 'foo' exist in release 'bar'?
> 
> Looking at the UDD wiki page and the associated examples, it seems like
> the query I need is something roughly like:
> 
> SELECT COUNT(*) FROM public.packages WHERE source='foo' AND release='bar';
> 
> Is this the best approach?

FWIW there are python bindings and CLI tools for UDD floating around ... I 
really should package them (and having people interested in them would be 
good motivation for that)

$ ipython3

In [1]: import uddcache.udd
In [2]: udd = uddcache.udd.Udd()
In [3]: pkg = udd.BindPackage('libc6', arch='amd64', release='bullseye')

In [4]: pkg.IsAvailable()
Out[4]: True

In [5]: pkg = udd.BindPackage('no-such-package', arch='amd64', 
release='bullseye')
In [6]: pkg.IsAvailable()
Out[6]: False


$ udd-cache versions libc6
Package: libc6 None/amd64
squeeze:                       2.11.3-4
wheezy:                        2.13-38+deb7u10
wheezy-security:               2.13-38+deb7u12
jessie:                        2.19-18+deb8u10
jessie-security:               2.19-18+deb8u10
stretch-security:              2.24-11+deb9u1
stretch:                       2.24-11+deb9u4
buster:                        2.28-10
bullseye:                      2.29-7
sid:                           2.29-9
experimental:                  2.30-0experimental1

$ udd-cache versions libc6 --release bullseye
Package: libc6 bullseye/amd64
bullseye:                      2.29-7

$ udd-cache versions no-such-package --release bullseye
No package named 'no-such-package' was found in bullseye/amd64.

cheers
Stuart

-- 
Stuart Prescott    http://www.nanonanonano.net/   stuart@nanonanonano.net
Debian Developer   http://www.debian.org/         stuart@debian.org
GPG fingerprint    90E2 D2C1 AD14 6A1B 7EBB 891D BBC1 7EBB 1396 F2F7


Reply to: