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/ii-connect | 3 ++- bin/wtf | 36 ++++++++++++++++++++++++++++++++++++ conf/pkgfile.pacman32.conf | 37 ------------------------------------- 3 files changed, 38 insertions(+), 38 deletions(-) create mode 100755 bin/wtf delete mode 100644 conf/pkgfile.pacman32.conf 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 == "") { + 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); + } + } + ' diff --git a/conf/pkgfile.pacman32.conf b/conf/pkgfile.pacman32.conf deleted file mode 100644 index cb73152..0000000 --- a/conf/pkgfile.pacman32.conf +++ /dev/null @@ -1,37 +0,0 @@ -# pacman.conf for pkgfile to search through i686 repositories - -[staging] -Server = https://mirror.archlinux32.org/i686/$repo - -[community-staging] -Server = https://mirror.archlinux32.org/i686/$repo - -[testing] -Server = https://mirror.archlinux32.org/i686/$repo - -[community-testing] -Server = https://mirror.archlinux32.org/i686/$repo - -[core] -Server = https://mirror.archlinux32.org/i686/$repo - -[extra] -Server = https://mirror.archlinux32.org/i686/$repo - -[community] -Server = https://mirror.archlinux32.org/i686/$repo - -# If you want to run 32 bit applications on your x86_64 system, -# enable the multilib repositories as required here. - -#[multilib-testing] -#Include = /etc/pacman.d/mirrorlist - -#[multilib] -#Include = /etc/pacman.d/mirrorlist - -# An example of a custom package repository. See the pacman manpage for -# tips on creating your own repositories. -#[custom] -#SigLevel = Optional TrustAll -#Server = file:///home/custompkgs -- cgit v1.2.3