Last active
August 31, 2022 08:37
-
-
Save mschmitt/336e0badce52932f115b8f2d93ac2983 to your computer and use it in GitHub Desktop.
List the contents of an APT repository (Packages.gz)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -an | |
# List the contents of an APT repository | |
# | |
# Input: Unpacked contents of Packages.{xz,gz} | |
# Output: [package] [version] | |
# | |
# curl -s http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | | |
# xz -dc | apt_package_and_version | grep '^bash ' | |
# | |
# Taken from a one-liner in one of my shell scripts. Sorry. | |
if($F[0]=~/^Package:/){$p=$F[1]};if($F[0]=~/^Version:/){$v=$F[1];print"$p $v\n";} | |
# https://gist.github.com/mschmitt/336e0badce52932f115b8f2d93ac2983 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment