aboutsummaryrefslogtreecommitdiff
path: root/apk-file
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-20 01:06:10 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-20 01:06:10 +0100
commit6e23c239779c290eb7f50a9718159eadd18e1a46 (patch)
tree07ee5358c2622cd9bb8e7390e57a31f4bdb60e81 /apk-file
parent9d07cbc04a97a03034b2deb2107cb86db28b0f71 (diff)
downloadalpine-6e23c239779c290eb7f50a9718159eadd18e1a46.tar.gz
Show repo in apk-file output
Diffstat (limited to 'apk-file')
-rwxr-xr-xapk-file9
1 files changed, 3 insertions, 6 deletions
diff --git a/apk-file b/apk-file
index 6ad3064..ede71d1 100755
--- a/apk-file
+++ b/apk-file
@@ -1,13 +1,10 @@
#!/bin/sh
-arch=$2
-: ${arch:=x86}
-
curl -s "https://pkgs.alpinelinux.org/contents?file=$1" |
awk '
/<td>/ { print }
- /<td class="arch">/ { getline; getline; print }
+ /<td class="(arch|repo)">/ { getline; getline; print }
' |
sed 's/^ *//; s/<[^>]*>//g; s,&#x2F;,/,g' |
-paste - - - - |
-grep "$arch\$"
+paste - - - - - |
+grep "${2:-x86}\$"