aboutsummaryrefslogtreecommitdiff
path: root/apk-file
blob: f5abc5fb43ad891ee7a8b4c405df66696f9f7f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# Search packages by contents

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,&#x2F;,/,g' |
paste - - - - - |
column -to '   ' |
{ test -t 1 && cut -c -$COLUMNS || cat; }