Package: devscripts Version: 2.22.1~bpo11+1 Severity: wishlist File: /usr/bin/rmadison
Please extend the rmadison parser so it can add &f=json to the URL it fetches. This avoids people post-processing text to get json out. 01:08 <REDACTED1> TIL (from twb's comment earlier) "rmadison -u ubuntu" to find out package versions from ubuntu 01:09 <REDACTED2> It's super slow. :-/ 01:11 <REDACTED3> And the output format differs 01:11 <REDACTED1> REDACTED2: indeed 01:12 <REDACTED3> so better not shell-parse that 01:13 <REDACTED1> the output here only seems to differ by a leading space in front of the package name 01:14 <REDACTED3> yes 01:19 <REDACTED1> rmadison $pkg | sed 's/ \+/ /g' | jc --csv goes a long way to parsing the output though :) 01:19 <REDACTED3> TIL: jc 01:20 <REDACTED2> TIL there's no python-is-python2 in Ubuntu 22.04. 01:27 <REDACTED2> For me, "jc --csv" produces garbage on rmadison output. 01:30 <REDACTED2> Like... it assumes that the first line is a header, and uses "6" (?!) as the column separator. 01:30 <REDACTED1> oh hmm here (sid) it recognized the | as the separating character. but I saw after posting that command that one would need to add a columns title line with echo for the json objects to make sense 01:31 <REDACTED1> anyway .. like you were saying, it's not super trivial to parse. 02:18 <twb> REDACTED1: I think this is probably easier: https://api.ftp-master.debian.org/madison?package=mg&f=json 02:19 <twb> The args rmadison passes are all single-letter codes, file:///usr/bin/rmadison#lines=197-209 Example output: $ curl -s 'https://api.ftp-master.debian.org/madison?package=mg&f=json&a=source&s=testing' | jq . [ { "mg": { "testing": { "20210609-1": { "component": "main", "architectures": [ "source" ], "source": "mg", "source_version": "20210609-1" } } } } ] Note that this does NOT work for Ubuntu. $ curl https://people.canonical.com/~ubuntu-archive/madison.cgi?package=mg\&f=json <title>dak ls aka madison</title> ⋮ <h2>dak ls mg</h2> mg | 20110905-1.1 | trusty/universe | source, amd64, arm64, armhf, i386, powerpc, ppc64el mg | 20160118-2 | xenial/universe | source, amd64, arm64, armhf, i386, powerpc, ppc64el, s390x mg | 20171014-1 | bionic/universe | source, amd64, arm64, armhf, i386, ppc64el, s390x mg | 20180927-1 | focal/universe | source, amd64, arm64, armhf, ppc64el, riscv64, s390x mg | 20200723-1 | impish/universe | source, amd64, arm64, armhf, ppc64el, riscv64, s390x mg | 20200723-1 | jammy/universe | source, amd64, arm64, armhf, ppc64el, riscv64, s390x mg | 20210609-1 | kinetic/universe | source, amd64, arm64, armhf, ppc64el, riscv64, s390x ⋮ Usage: dak ls [OPTION] PACKAGE[...] Display information about PACKAGE(s). -a, --architecture=ARCH only show info for ARCH(s) -c, --component=COMPONENT only show info for COMPONENT(s) -h, --help show this help and exit -r, --regex treat PACKAGE as a regex <i>[not supported in madison.cgi]</i> -s, --suite=SUITE only show info for this suite -S, --source-and-binary show info for the binary children of source pkgs ARCH, COMPONENT and SUITE can be comma (or space) separated lists, e.g. --architecture=m68k,i386 ⋮ -- Package-specific info: --- /etc/devscripts.conf --- Empty. --- ~/.devscripts --- BTS_CACHE=no DEBCHANGE_RELEASE_HEURISTIC=changelog DEB_BUILD_HARDENING=1 DEB_BUILD_OPTIONS=parallel=$(getconf _NPROCESSORS_ONLN || echo 1) -- System Information: Debian Release: 11.3 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'proposed-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 5.16.0-0.bpo.4-amd64 (SMP w/8 CPU threads; PREEMPT) Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages devscripts depends on: ii dpkg-dev 1.20.10 ii fakeroot 1.25.3-1.1 ii file 1:5.39-3 ii gnupg 2.2.27-2+deb11u1 ii gpgv 2.2.27-2+deb11u1 ii libc6 2.31-13+deb11u3 ii libfile-dirlist-perl 0.05-2 ii libfile-homedir-perl 1.006-1 ii libfile-touch-perl 0.11-1 ii libfile-which-perl 1.23-1 ii libipc-run-perl 20200505.0-1 ii libmoo-perl 2.004004-1 ii libwww-perl 6.52-1 ii patchutils 0.4.2-1 ii perl 5.32.1-4+deb11u2 ii python3 3.9.2-3 ii sensible-utils 0.0.14 ii wdiff 1.2.2-2+b1 Versions of packages devscripts recommends: ii apt 2.2.4 ii curl 7.74.0-1.3+deb11u1 ii dctrl-tools 2.24-3+b1 ii debian-keyring 2021.07.26 ii dput 1.1.0 ii equivs 2.3.1 ii libdistro-info-perl 1.0 ii libdpkg-perl 1.20.10 ii libencode-locale-perl 1.05-1.1 ii libgit-wrapper-perl 0.048-1 ii libgitlab-api-v4-perl 0.26-1 ii liblist-compare-perl 0.55-1 ii liblwp-protocol-https-perl 6.10-1 ii libsoap-lite-perl 1.27-1 ii libstring-shellquote-perl 1.04-1 ii libtry-tiny-perl 0.30-1 ii liburi-perl 5.08-1 ii licensecheck 3.1.1-2 ii lintian 2.111.0~bpo11+1 ii man-db 2.9.4-2 ii patch 2.7.6-7 ii pristine-tar 1.49 ii python3-apt 2.2.1 ii python3-debian 0.1.39 ii python3-magic 2:0.4.20-3 ii python3-requests 2.25.1+dfsg-2 ii python3-unidiff 0.5.5-2 ii python3-xdg 0.27-2 ii strace 5.10-1 ii unzip 6.0-26 ii wget 1.21-1+deb11u1 ii xz-utils 5.2.5-2.1~deb11u1 Versions of packages devscripts suggests: pn adequate <none> pn at <none> pn autopkgtest <none> pn bls-standalone <none> ii bsd-mailx [mailx] 8.1.2-0.20180807cvs-2 ii build-essential 12.9 pn check-all-the-things <none> pn cvs-buildpackage <none> ii debhelper 13.3.4 pn diffoscope <none> pn disorderfs <none> pn dose-extra <none> pn duck <none> pn elpa-devscripts <none> pn faketime <none> ii gnuplot-nox [gnuplot] 5.4.1+dfsg1-1+deb11u1 ii how-can-i-help 17 ii libauthen-sasl-perl 2.1600-1.1 pn libdbd-pg-perl <none> ii libfile-desktopentry-perl 0.22-2 pn libnet-smtps-perl <none> pn libterm-size-perl <none> ii libtimedate-perl 2.3300-2 pn libyaml-syck-perl <none> ii mailutils [mailx] 1:3.10-3+b1 ii mmdebstrap 0.7.5-2.2 pn mozilla-devscripts <none> ii mutt 2.0.5-4.1twb1 ii openssh-client [ssh-client] 1:8.4p1-5 pn piuparts <none> pn postgresql-client <none> pn pristine-lfs <none> ii quilt 0.66-2.1 pn ratt <none> pn reprotest <none> pn svn-buildpackage <none> ii w3m 0.5.3+git20210102-6 -- no debconf information