diff options
Diffstat (limited to 'apk-file')
-rwxr-xr-x | apk-file | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,11 +2,14 @@ # Search packages by contents -curl -s "https://pkgs.alpinelinux.org/contents?file=$1" | +COLUMNS=`resize | cut -d\; -f1 | cut -d= -f2` + +curl -s "https://pkgs.alpinelinux.org/contents?file=$1&arch=${2:-x86}" | awk ' /<td>/ { print } /<td class="(arch|repo)">/ { getline; getline; print } ' | sed 's/^ *//; s/<[^>]*>//g; s,/,/,g' | paste - - - - - | -grep "${2:-x86}\$" +column -to ' ' | +{ test -t 1 && cut -c -$COLUMNS || cat; } |