Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ii-connect3
-rwxr-xr-xbin/wtf36
2 files changed, 38 insertions, 1 deletions
diff --git a/bin/ii-connect b/bin/ii-connect
index 4050bd0..0ecb987 100755
--- a/bin/ii-connect
+++ b/bin/ii-connect
@@ -94,7 +94,8 @@ if [ "$1" = 'watch' ]; then
p
' "${out_file}" | \
while read -r line; do
- if ! reason=$(pkgfile -C "${base_dir}/conf/pkgfile.pacman32.conf" "${line}"); then
+ reason=$("${base_dir}/bin/wtf" "${line}");
+ if [ -z "${reason}" ] then
reason="Huh, I don't know that one."
fi
if [ "$(echo "${reason}" | wc -l)" -le 5 ]; then
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);
+ }
+ }
+ '