1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-12-23 23:50:51 +01:00

Add automatic update chacking script

Crunch project websites and try to find the latest version for each
package without having to do the work manually.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-05-06 17:23:31 +02:00
parent acd2a1f57f
commit b1bdce20a9
74 changed files with 488 additions and 7 deletions

27
check_update.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
set -e
SCRIPTDIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)
# dummy toolchain variables
export LINUXPKG="linux"
# utilities
source "$SCRIPTDIR/util/depends.sh"
source "$SCRIPTDIR/util/version.sh"
source "$SCRIPTDIR/util/misc.sh"
# check all packages
for pkg in $SCRIPTDIR/pkg/*; do
[ -d $pkg ] || continue;
name=$(basename $pkg)
echo "-- checking $name"
source "$pkg/build"
version=$(check_update)
if [ ! -z $version ]; then
echo "$name has newer version: $version"
fi
done

View file

@ -24,3 +24,10 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
curl --silent -L "$URL" | \
grep -o ">bash-completion-[0-9.]*tar.gz<" | grep -v "2008" |\
sed 's/>bash-completion-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -35,3 +35,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
rm -r "$DEPLOY/lib"
}
check_update() {
curl --silent -L "$URL" | grep -o ">bash-[0-9.]*tar.gz<" | \
sed 's/>bash-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -30,3 +30,10 @@ deploy() {
mkdir -p "$DEPLOY/bin"
cp "$PKGBUILDDIR/busybox" "$DEPLOY/bin"
}
check_update() {
curl --silent -L "$URL" | \
grep -o ">busybox-[0-9.]*tar.bz2<" | \
sed 's/>busybox-//g' | sed 's/.tar.bz2<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -29,3 +29,9 @@ deploy() {
rm -r "$DEPLOY/docs"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
# we need to login to access newer versions
# ... because Oracle, thats why!
return
}

View file

@ -32,3 +32,10 @@ deploy() {
strip_files ${DEPLOY}/{bin,lib}/*
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
curl --silent -L "$URL" | \
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

@ -36,3 +36,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
rmdir "$DEPLOY/lib"
}
check_update() {
curl --silent -L "$URL" | grep -o "bzip2-[0-9.]*tar.gz" | \
sed 's/bzip2-//g' | sed 's/.tar.gz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -23,3 +23,9 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip
rm -r "$DEPLOY/share" "$DEPLOY/lib"
}
check_update() {
curl --silent -L "$URL" | grep -o ">coreutils-[0-9.]*tar.xz<" | \
sed 's/>coreutils-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -34,3 +34,9 @@ deploy() {
rm -rf "$DEPLOY/usr"
}
check_update() {
curl --silent -L "$URL" | grep -o ">dhcpcd-[0-9.]*tar.xz<" | \
sed 's/>dhcpcd-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -23,3 +23,9 @@ deploy() {
rm -r "$DEPLOY/share" "$DEPLOY/lib"
}
check_update() {
curl --silent -L "$URL" | grep -o ">diffutils-[0-9.]*tar.xz<" | \
sed 's/>diffutils-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -35,3 +35,9 @@ deploy() {
mkdir -p "$DEPLOY/etc/dnsmasq.d"
}
check_update() {
curl --silent -L "$URL" | grep -o ">dnsmasq-[0-9.]*tar.xz<" | \
sed 's/>dnsmasq-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -24,3 +24,10 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip
rm -r "$DEPLOY/share"
}
check_update() {
curl --silent -L "https://github.com/dosfstools/dosfstools/releases" |\
grep -o "dosfstools-[0-9.]*tar.xz" | \
sed 's/dosfstools-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -23,3 +23,9 @@ deploy() {
rm -r "$DEPLOY/share"
}
check_update() {
curl --silent -L "$URL" | grep -o "ethtool-[0-9.]*tar.xz" | \
sed 's/ethtool-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -31,3 +31,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
rmdir "$DEPLOY/share"
}
check_update() {
curl --silent -L "$URL" | grep -o "eudev-[0-9.]*tar.gz" | \
sed 's/eudev-//g' | sed 's/.tar.gz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -27,3 +27,12 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
local version=$(echo "$VERSION" | sed 's/R_//g' | sed 's/_/./g')
curl --silent -L "https://github.com/libexpat/libexpat/releases" | \
grep -o "expat-[0-9.]*tar.bz2" | \
sed 's/expat-//g' | sed 's/.tar.bz2//g' | \
verson_find_greatest "$version"
}

View file

@ -26,3 +26,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
curl --silent --list-only "$URL/" | grep -o "file-[0-9.]*tar.gz" | \
sed 's/file-//g' | sed 's/.tar.gz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -24,3 +24,9 @@ deploy() {
rm -r "$DEPLOY/share" "$DEPLOY/lib"
}
check_update() {
curl --silent -L "$URL" | grep -o ">findutils-[0-9.]*tar.gz<" | \
sed 's/>findutils-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -32,3 +32,9 @@ deploy() {
strip_files ${DEPLOY}/opt/vc/lib/*.so
strip_files ${DEPLOY}/opt/vc/lib/plugins/*.so
}
check_update() {
curl --silent -L https://github.com/raspberrypi/firmware/releases | \
grep -o "[0-9.]\+tar.gz" | sed 's/.tar.gz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -24,3 +24,9 @@ deploy() {
rm "$DEPLOY/bin/gawk-$VERSION"
rm -r "$DEPLOY/include" "$DEPLOY/share/info" "$DEPLOY/share/man"
}
check_update() {
curl --silent -L "$URL" | grep -o ">gawk-[0-9.]*tar.xz<" | \
sed 's/>gawk-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -27,3 +27,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
strip_files ${DEPLOY}/lib/*.so*
}
check_update() {
curl --silent -L "$URL" | grep -o ">gmp-[0-9.]*tar.bz2<" | \
sed 's/>gmp-//g' | sed 's/.tar.bz2<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -22,3 +22,9 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip
rm -r "$DEPLOY/share" "$DEPLOY/lib"
}
check_update() {
curl --silent -L "$URL" | grep -o ">grep-[0-9.]*tar.xz<" | \
sed 's/>grep-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -22,3 +22,9 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip
rm -r "$DEPLOY/share"
}
check_update() {
curl --silent -L "$URL" | grep -o ">gzip-[0-9.]*tar.xz<" | \
sed 's/>gzip-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -21,3 +21,7 @@ deploy() {
cp "$SOURCE/protocols" "$DEPLOY/etc"
cp "$SOURCE/services" "$DEPLOY/etc"
}
check_update() {
return
}

View file

@ -27,3 +27,9 @@ deploy() {
rm -r "$DEPLOY/share" "$DEPLOY/lib"
(rmdir "$DEPLOY/libexec" || true) 2> /dev/null ;
}
check_update() {
curl --silent -L "$URL" | grep -o ">inetutils-[0-9.]*tar.xz<" | \
sed 's/>inetutils-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -71,3 +71,7 @@ deploy() {
unset -v i GETTY_TTY HWCLOCK DHCP_PORTS
}
check_update() {
return
}

View file

@ -26,3 +26,7 @@ slink /bin/sh /bin/busybox 0777 0 0
file /init $DEPLOY/init 0775 0 0
_EOF
}
check_update() {
return
}

View file

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

View file

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

View file

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

View file

@ -25,3 +25,9 @@ deploy() {
rm -r "$DEPLOY/share"
}
check_update() {
curl --silent -L "$URL" | grep -o ">less-[0-9.]*tar.gz<" | \
sed 's/>less-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

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

View file

@ -27,3 +27,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
strip_files ${DEPLOY}/lib/*
}
check_update() {
curl --silent -L https://github.com/libevent/libevent/releases | \
grep -o "libevent-[0-9.]*-stable" | grep -o "[0-9.]*" | \
verson_find_greatest "$VERSION"
}

View file

@ -28,3 +28,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
strip_files ${DEPLOY}/{bin,lib}/*
}
check_update() {
curl --silent -L "$URL" | grep -o ">libiconv-[0-9.]*tar.gz<" | \
sed 's/>libiconv-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -32,3 +32,12 @@ deploy() {
install -m 755 "arch/arm/boot/zImage" "$DEPLOY/vmlinuz"
}
check_update() {
local version=$(echo $VERSION | sed 's/-[0-9]*$//g')
curl --silent -L "https://github.com/raspberrypi/linux/releases" | \
grep -o "raspberrypi-kernel_[0-9.]*-[0-9]" | \
sed 's/raspberrypi-kernel_//g' | sed 's/-/./g' | \
verson_find_greatest "$version"
}

View file

@ -34,3 +34,10 @@ deploy() {
install -m 755 "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/vmlinuz"
}
check_update() {
curl --silent -L https://www.kernel.org/ | \
grep -o linux-[0-9.]*tar.xz | \
sed 's/linux-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
}

View file

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

View file

@ -32,3 +32,9 @@ deploy() {
strip_files ${DEPLOY}/lib/*
}
check_update() {
curl --silent -L "$URL" | grep -o ">musl-[0-9.]*tar.gz<" | \
sed 's/>musl-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -23,3 +23,9 @@ deploy() {
rm -r "$DEPLOY/share" "$DEPLOY/lib"
}
check_update() {
curl --silent -L "$URL" | grep -o ">nano-[0-9.]*tar.xz<" | \
sed 's/>nano-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

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

View file

@ -25,3 +25,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
strip_files ${DEPLOY}/{bin,lib}/*
}
check_update() {
curl --silent -L "$URL" | grep -o ">nettle-[0-9.]*tar.gz<" | \
sed 's/>nettle-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -23,3 +23,9 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip
}
check_update() {
curl --silent -L "$URL" | grep -o ">nftables-[0-9.]*tar.bz2<" | \
sed 's/>nftables-//g' | sed 's/.tar.bz2<//g' | grep -v 0.099 |\
verson_find_greatest "$VERSION"
}

View file

@ -35,3 +35,11 @@ deploy() {
install -v -m755 "$SOURCE/contrib/ssh-copy-id" "$DEPLOY/bin"
}
check_update() {
local version=$(echo $VERSION | sed 's/p/./g')
curl --silent -L "$URL" | grep -o ">openssh-[0-9.]*p[0-9]*.tar.gz<" | \
sed 's/>openssh-//g' | sed 's/.tar.gz<//g' | sed 's/p/./g' | \
verson_find_greatest "$version"
}

View file

@ -31,3 +31,12 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
strip_files ${DEPLOY}/bin/* ${DEPLOY}/lib/*.so*
}
check_update() {
local version=$(echo $VERSION | sed 's/\([[:lower:]]\)/.\1/g')
curl --silent -L "$URL" | grep -o ">openssl-[0-9a-z.]*tar.gz<" | \
sed 's/>openssl-//g' | sed 's/.tar.gz<//g' | \
sed 's/\([[:lower:]]\)/.\1/g' | \
verson_find_greatest "$version"
}

View file

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

View file

@ -26,3 +26,9 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip
rm -r "$DEPLOY/share"
}
check_update() {
curl --silent -L $URL | grep -o ">psmisc-[0-9.]*tar.xz<" | \
sed 's/>psmisc-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -28,3 +28,9 @@ deploy() {
chmod 755 ${DEPLOY}/lib/*
strip_files ${DEPLOY}/lib/*
}
check_update() {
curl --silent -L $URL | grep -o ">readline-[0-9.]*tar.gz<" | \
sed 's/>readline-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -35,3 +35,7 @@ deploy() {
tar czf "$DEPLOY/$PKGNAME.tar.gz" *
}
check_update() {
return
}

View file

@ -36,3 +36,7 @@ deploy() {
tar czf "$DEPLOY/$PKGNAME.tar.gz" *
}
check_update() {
return
}

View file

@ -59,3 +59,7 @@ deploy() {
find $PKGBUILDDIR/{bin,lib,share} -type d -exec chmod u+w {} \;
find $PKGBUILDDIR/{bin,lib,share} -type f -exec chmod u+w {} \;
}
check_update() {
return
}

View file

@ -23,3 +23,9 @@ deploy() {
rm -r "$DEPLOY/share" "$DEPLOY/lib"
}
check_update() {
curl --silent -L $URL | grep -o ">sed-[0-9.]*tar.xz<" | \
sed 's/>sed-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -38,3 +38,10 @@ deploy() {
rm $DEPLOY/bin/{vigr,vipw,chsh}
}
check_update() {
curl --silent -L https://github.com/shadow-maint/shadow/releases | \
grep -o "shadow-[0-9.]*tar.xz" | \
sed 's/shadow-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -26,3 +26,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
curl --silent -L https://sqlite.org/download.html | \
grep -o sqlite-autoconf-[0-9]*.tar.gz | grep -o [0-9]* | \
verson_find_greatest "$VERSION"
}

View file

@ -23,3 +23,9 @@ deploy() {
rm -r "$DEPLOY/share" "$DEPLOY/lib"
}
check_update() {
curl --silent -L $URL | grep -o ">tar-[0-9.]*tar.xz<" | \
sed 's/>tar-//g' | sed 's/.tar.xz<//g' | \
verson_find_greatest "$VERSION"
}

View file

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

View file

@ -16,3 +16,9 @@ build() {
deploy() {
return
}
check_update() {
curl --silent --list-only "$URL/" | grep -o "cloog-[0-9.]*tar.gz" | \
sed 's/cloog-//g' | sed 's/.tar.gz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -40,3 +40,10 @@ build() {
deploy() {
make install-gcc install-target-libgcc
}
check_update() {
curl --silent -L "http://ftp.gnu.org/gnu/gcc" | \
grep -o ">gcc-[0-9.]*/<" | \
sed 's/>gcc-//g' | sed 's/\/<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -1,8 +1,5 @@
VERSION="6.1.2"
SRCDIR="gmp-$VERSION"
TARBALL="gmp-$VERSION.tar.bz2"
URL="http://ftp.gnu.org/gnu/gmp"
SHA256SUM="5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2"
# inherit package details from target GMP package
source "$SCRIPTDIR/pkg/gmp/build"
DEPENDS=""
prepare() {
@ -15,4 +12,4 @@ build() {
deploy() {
return
}
}

View file

@ -16,3 +16,9 @@ build() {
deploy() {
return
}
check_update() {
curl --silent --list-only "$URL/" | grep -o "isl-[0-9.]*tar.bz2" | \
sed 's/isl-//g' | sed 's/.tar.bz2//g' | \
verson_find_greatest "$VERSION"
}

View file

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

View file

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

View file

@ -27,3 +27,9 @@ deploy() {
ln -s pkg-config "$TCDIR/bin/$TARGET-pkg-config"
}
check_update() {
curl --silent -L "$URL" | grep -o ">pkg-config-[0-9.]*tar.gz<" | \
sed 's/>pkg-config-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -23,3 +23,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
_EOF
save_toolchain
}
check_update() {
return
}

View file

@ -40,3 +40,9 @@ _EOF
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
strip_files ${DEPLOY}/{bin,lib}/*
}
check_update() {
curl --silent -L "$URL" | grep -o ">unbound-[0-9.]*tar.gz<" | \
sed 's/>unbound-//g' | sed 's/.tar.gz<//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -61,3 +61,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
curl --silent -L "https://www.kernel.org/pub/linux/utils/util-linux" | \
grep -o "v[0-9.]*/" | grep -o "[0-9.]*" | \
verson_find_greatest "$VERSION"
}

View file

@ -26,3 +26,9 @@ deploy() {
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
}
check_update() {
curl --silent -L "$URL" | grep -o "xz-[0-9.]*tar.xz" | \
sed 's/xz-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -28,3 +28,9 @@ deploy() {
rm -r ${DEPLOY}/share
}
check_update() {
curl --silent -L "$URL" | grep -o "xz-[0-9.]*tar.xz" | \
sed 's/zlib-//g' | sed 's/.tar.xz//g' | \
verson_find_greatest "$VERSION"
}

View file

@ -1,7 +1,7 @@
include_pkg() {
PKGNAME="$1" # globally visible package name
unset -f build deploy prepare
unset -f build deploy prepare check_update
unset -v VERSION TARBALL URL SRCDIR SHA256SUM DEPENDS
source "$SCRIPTDIR/pkg/$PKGNAME/build"
}

33
util/version.sh Normal file
View file

@ -0,0 +1,33 @@
get_version_field() {
local field=$(echo "$1" | cut -d. -f$2 | sed 's/^0*//')
if [ -z $field ]; then
field="0"
fi
case "$field" in
[a-zA-Z]) printf '%d' "'$field'" ;;
*) echo "$field" ;;
esac
}
verson_find_greatest() {
local version i v V
local found="$1"
while read version; do
for i in 1 2 3 4; do
v=$(get_version_field $version $i)
V=$(get_version_field $found $i)
[ $v -ge $V ] || break
if [ $v -gt $V ]; then
found="$version"
break
fi
done
done
if [ "$found" != "$1" ]; then
echo "$found"
fi
}