1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 02:59:47 +01:00

cleanup: add common implementation of check_update

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-03-30 10:40:54 +01:00
parent 013692b999
commit 94ccf6d7e2
49 changed files with 62 additions and 149 deletions

View file

@ -26,7 +26,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">bash-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "bash-" "tar.gz"
sed 's/>bash-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -30,8 +30,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | \ check_update_simple "$URL" "busybox-" "tar.bz2"
grep -o ">busybox-[0-9.]*tar.bz2<" | \
sed 's/>busybox-//g' | sed 's/.tar.bz2<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -25,8 +25,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | \ check_update_simple "$URL" "btrfs-progs-v" "tar.xz"
grep -o ">btrfs-progs-v[0-9.]*tar.xz<" | \
sed 's/>btrfs-progs-v//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">coreutils-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "coreutils-" "tar.xz"
sed 's/>coreutils-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -27,7 +27,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">dhcpcd-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "dhcpcd-" "tar.xz"
sed 's/>dhcpcd-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">diffutils-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "diffutils-" "tar.xz"
sed 's/>diffutils-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -34,7 +34,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">dnsmasq-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "dnsmasq-" "tar.xz"
sed 's/>dnsmasq-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,8 +20,7 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "https://github.com/dosfstools/dosfstools/releases" |\ check_update_simple \
grep -o "dosfstools-[0-9.]*tar.xz" | \ "https://github.com/dosfstools/dosfstools/releases" \
sed 's/dosfstools-//g' | sed 's/.tar.xz//g' | \ "dosfstools-" "tar.xz"
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o "ethtool-[0-9.]*tar.xz" | \ check_update_simple "$URL" "ethtool-" "tar.xz"
sed 's/ethtool-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">findutils-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "findutils-" "tar.gz"
sed 's/>findutils-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">gawk-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "gawk-" "tar.xz"
sed 's/>gawk-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,9 +21,6 @@ deploy() {
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR" cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">gmp-[0-9.]*tar.bz2<" | \ check_update_simple "$URL" "gmp-" "tar.bz2"
sed 's/>gmp-//g' | sed 's/.tar.bz2<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">grep-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "grep-" "tar.xz"
sed 's/>grep-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">gzip-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "gzip-" "tar.xz"
sed 's/>gzip-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -36,7 +36,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">hostapd-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "hostapd-" "tar.gz"
sed 's/>hostapd-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -24,7 +24,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">inetutils-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "inetutils-" "tar.xz"
sed 's/>inetutils-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -32,7 +32,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L $URL | grep -o "iproute2-[0-9.]*tar.xz" | \ check_update_simple "$URL" "iproute2-" "tar.xz"
sed 's/iproute2-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -36,7 +36,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L $URL | grep -o "iw-[0-9.]*tar.xz" | \ check_update_simple "$URL" "iw-" "tar.xz"
sed 's/iw-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -22,7 +22,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">kbd-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "kbd-" "tar.xz"
sed 's/>kbd-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">kmod-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "kmod-" "tar.xz"
sed 's/>kmod-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -23,7 +23,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o "ldns-[0-9.]*tar.gz" | \ check_update_simple "$URL" "ldns-" "tar.gz"
sed 's/ldns-//g' | sed 's/.tar.gz//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">less-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "less-" "tar.gz"
sed 's/>less-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">libbsd-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "libbsd-" "tar.xz"
sed 's/>libbsd-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">libmnl-[0-9.]*tar.bz2<" | \ check_update_simple "$URL" "libmnl-" "tar.bz2"
sed 's/>libmnl-//g' | sed 's/.tar.bz2<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">libnftnl-[0-9.]*tar.bz2<" | \ check_update_simple "$URL" "libnftnl-" "tar.bz2"
sed 's/>libnftnl-//g' | sed 's/.tar.bz2<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -22,7 +22,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">libnl-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "libnl-" "tar.gz"
sed 's/>libnl-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -24,7 +24,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">libpcap-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "libpcap-" "tar.gz"
sed 's/>libpcap-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -19,7 +19,6 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L https://github.com/seccomp/libseccomp/releases | \ check_update_simple "https://github.com/seccomp/libseccomp/releases" \
grep -o "libseccomp-[0-9.]*tar.gz" | sed 's/libseccomp-//g' | \ "libseccomp-" "tar.gz"
sed 's/.tar.gz//g' | verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">lzo-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "lzo-" "tar.gz"
sed 's/>lzo-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -68,7 +68,5 @@ _EOF
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">musl-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "musl-" "tar.gz"
sed 's/>musl-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">nano-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "nano-" "tar.xz"
sed 's/>nano-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -27,7 +27,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">ncurses-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "ncurses-" "tar.gz"
sed 's/>ncurses-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -101,7 +101,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">nginx-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "nginx-" "tar.gz"
sed 's/>nginx-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">pcre-[0-9.]*tar.bz2<" | \ check_update_simple "$URL" "pcre-" "tar.bz2"
sed 's/>pcre-//g' | sed 's/.tar.bz2<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -23,7 +23,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">procps-ng-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "procps-ng-" "tar.xz"
sed 's/>procps-ng-//g' | sed 's/.tar.xz<//g' |\
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L $URL | grep -o ">psmisc-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "psmisc-" "tar.xz"
sed 's/>psmisc-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -22,7 +22,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L $URL | grep -o ">readline-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "readline-" "tar.gz"
sed 's/>readline-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L $URL | grep -o ">sed-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "sed-" "tar.xz"
sed 's/>sed-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -29,8 +29,6 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L https://github.com/shadow-maint/shadow/releases | \ check_update_simple "https://github.com/shadow-maint/shadow/releases" \
grep -o "shadow-[0-9.]*tar.xz" | \ "shadow-" "tar.xz"
sed 's/shadow-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -20,7 +20,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L $URL | grep -o ">tar-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "tar-" "tar.xz"
sed 's/>tar-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -49,7 +49,5 @@ _EOF
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">binutils-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "binutils-" "tar.xz"
sed 's/>binutils-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -19,7 +19,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">mpc-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "mpc-" "tar.gz"
sed 's/>mpc-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -19,7 +19,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">mpfr-[0-9.]*tar.xz<" | \ check_update_simple "$URL" "mpfr-" "tar.xz"
sed 's/>mpfr-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -31,7 +31,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">pkg-config-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "pkg-config-" "tar.gz"
sed 's/>pkg-config-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -22,7 +22,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">tcpdump-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "tcpdump-" "tar.gz"
sed 's/>tcpdump-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -42,7 +42,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o ">unbound-[0-9.]*tar.gz<" | \ check_update_simple "$URL" "unbound-" "tar.gz"
sed 's/>unbound-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -21,7 +21,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o "xz-[0-9.]*tar.xz" | \ check_update_simple "$URL" "xz-" "tar.xz"
sed 's/xz-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -32,7 +32,5 @@ deploy() {
} }
check_update() { check_update() {
curl --silent -L "$URL" | grep -o "xz-[0-9.]*tar.xz" | \ check_update_simple "$URL" "zlib-" "tar.xz"
sed 's/zlib-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
} }

View file

@ -31,3 +31,13 @@ verson_find_greatest() {
echo "$found" echo "$found"
fi fi
} }
check_update_simple() {
local url="$1"
local prefix="$2"
local suffix="$3"
curl --silent -L "$url" | grep -o ">$prefix-[0-9.]*$suffix<" | \
sed 's/>$prefix-//g' | sed 's/.$suffix<//g' | \
verson_find_greatest "$VERSION"
}