summaryrefslogtreecommitdiff
path: root/bin/wtf
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-11-23 13:30:23 +0100
committerErich Eckner <git@eckner.net>2018-11-23 13:30:23 +0100
commit52cd8cc368c7958a67e78ed0bd26f34b747689d0 (patch)
treef75c8e8fe62fdb26936fdf133a1823ac7a38f470 /bin/wtf
parent331292999a20dd39c38783862eb7ae62d587d4fa (diff)
downloadbuilder-52cd8cc368c7958a67e78ed0bd26f34b747689d0.tar.xz
bin/wtf, bin/update-pacman-dbs: answer queries for i486, too
Diffstat (limited to 'bin/wtf')
-rwxr-xr-xbin/wtf37
1 files changed, 34 insertions, 3 deletions
diff --git a/bin/wtf b/bin/wtf
index b87a41f..0077757 100755
--- a/bin/wtf
+++ b/bin/wtf
@@ -1,15 +1,46 @@
#!/bin/sh
+# wtf <file identifier>
+#
+# or
+#
+# wtf $arch <file identifier>
+#
+# where <file identifier> is on of:
+#
+# $filename
+# /$full/$path/$to/$file
+# $partial/$path/$to/$file
+
base_dir=$(
readlink -f "${0%/*}/.."
)
-# TODO: search i486, too
+case $1 in
+ 'i486')
+ arch='i486'
+ shift
+ ;;
+ 'i686')
+ arch='i686'
+ shift
+ ;;
+ *)
+ arch='i686'
+ ;;
+esac
search="$*"
-pkgfile -wC "${base_dir}/misc/pacman-i686.conf" -s "${search##*/}" | \
- xargs -rn1 pkgfile -wC "${base_dir}/misc/pacman-i686.conf" -l | \
+pkgfile -w \
+ -C "${base_dir}/misc/pacman-${arch}.conf" \
+ -D "${base_dir}/work/pkgfile-${arch}.cache" \
+ -s "${search##*/}" | \
+ xargs -rn1 \
+ pkgfile -w \
+ -C "${base_dir}/misc/pacman-${arch}.conf" \
+ -D "${base_dir}/work/pkgfile-${arch}.cache" \
+ -l | \
if printf '%s\n' "${search}" | \
grep -q '^/'; then
grep -w "${search}"