From 6bd916585024b7e4b344288bdcf2dece207cd8dc Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 7 Apr 2018 22:12:40 +0200 Subject: ii-connect: wtf: pkgfile -> tyzoid's interface --- bin/wtf | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 bin/wtf (limited to 'bin/wtf') diff --git a/bin/wtf b/bin/wtf new file mode 100755 index 0000000..a54930d --- /dev/null +++ b/bin/wtf @@ -0,0 +1,36 @@ +#!/bin/sh + +wget -qO- 'https://pkgapi.arch32.tyzoid.com/esearch/'"$*"'.xml' | \ + awk ' + BEGIN { + package=""; + version=""; + repo=""; + filelen=0; + } + { + if ($1 == "") { + printf "[" repo "] " package " (" version "):"; + for (i=1; i <= filelen; i++) { + printf " " file[i]; + } + print ""; + package=""; + version=""; + repo=""; + filelen=0; + } + if ($1 ~ /^/) { + package = gensub(/<[^>]+>/, " ", "g", $1); + } + if ($1 ~ /^/) { + version = gensub(/<[^>]+>/, "", "g", $1); + } + if ($1 ~ /^/) { + repo = gensub(/<[^>]+>/, "", "g", $1); + } + if ($1 ~ /^/) { + file[++filelen] = gensub(/<[^>]+>/, "", "g", $1); + } + } + ' -- cgit v1.2.3-70-g09d2