diff options
author | John Ankarström <john@ankarstrom.se> | 2020-11-20 00:54:34 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-11-20 00:56:49 +0100 |
commit | 9d07cbc04a97a03034b2deb2107cb86db28b0f71 (patch) | |
tree | 2d354da37402ac46b498a53d4ae0384c987f4250 /apk-file | |
parent | 4229736346c6909c4125ea9ee580b2ce53e34d45 (diff) | |
download | alpine-9d07cbc04a97a03034b2deb2107cb86db28b0f71.tar.gz |
Add 'apk-file' tool
Diffstat (limited to 'apk-file')
-rwxr-xr-x | apk-file | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apk-file b/apk-file new file mode 100755 index 0000000..6ad3064 --- /dev/null +++ b/apk-file @@ -0,0 +1,13 @@ +#!/bin/sh + +arch=$2 +: ${arch:=x86} + +curl -s "https://pkgs.alpinelinux.org/contents?file=$1" | +awk ' + /<td>/ { print } + /<td class="arch">/ { getline; getline; print } +' | +sed 's/^ *//; s/<[^>]*>//g; s,/,/,g' | +paste - - - - | +grep "$arch\$" |