Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/wtf
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-07 22:12:40 +0200
committerErich Eckner <git@eckner.net>2018-04-07 22:12:40 +0200
commit6bd916585024b7e4b344288bdcf2dece207cd8dc (patch)
tree2198aae24debbf4f1477a36a8515e14c898006e5 /bin/wtf
parentd0748b2c4b25fb01706ae225c0181c2e25804a8a (diff)
ii-connect: wtf: pkgfile -> tyzoid's interface
Diffstat (limited to 'bin/wtf')
-rwxr-xr-xbin/wtf36
1 files changed, 36 insertions, 0 deletions
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 == "</package>") {
+ printf "[" repo "] " package " (" version "):";
+ for (i=1; i <= filelen; i++) {
+ printf " " file[i];
+ }
+ print "";
+ package="";
+ version="";
+ repo="";
+ filelen=0;
+ }
+ if ($1 ~ /^<name>/) {
+ package = gensub(/<[^>]+>/, " ", "g", $1);
+ }
+ if ($1 ~ /^<version>/) {
+ version = gensub(/<[^>]+>/, "", "g", $1);
+ }
+ if ($1 ~ /^<repo>/) {
+ repo = gensub(/<[^>]+>/, "", "g", $1);
+ }
+ if ($1 ~ /^<file>/) {
+ file[++filelen] = gensub(/<[^>]+>/, "", "g", $1);
+ }
+ }
+ '