From: fsLeg Date: Sun, 28 Sep 2025 16:36:55 +0000 (+0300) Subject: Added the script I use for incremental updates X-Git-Url: https://git.t-rg.ws/?a=commitdiff_plain;h=94d6a59ac97188b905aac43bf68d98bbe1731373;p=slackbuilds.git Added the script I use for incremental updates --- diff --git a/update-version.sh b/update-version.sh new file mode 100755 index 0000000..c5f8a62 --- /dev/null +++ b/update-version.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# Update the version of SlackBuilds. Useful for incremental updates. +# Intended to be run from the root of the repo. +# It updates the version in the .SlackBuild and .info files, generates +# vendored-sources tarball and updates MD5 checksums in the .info file. + +set -e + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Usage: $0 PRGNAM NEWVER" + exit 1 +fi + +PRGNAM="${1%/}" +NEWVER="$2" +CWD="$(pwd)" + +cd "$PRGNAM" + +. "./$PRGNAM.info" +sed -i "s|$VERSION|$NEWVER|g" "$PRGNAM.SlackBuild" "$PRGNAM.info" + +. "./$PRGNAM.info" +if [ "$DOWNLOAD" != "UNSUPPORTED" ]; then + wget --tries=inf --retry-on-http-error=503 $DOWNLOAD || true +fi +if [ -n "$DOWNLOAD_x86_64" ]; then + wget --tries=inf --retry-on-http-error=503 $DOWNLOAD_x86_64 || true +fi + +if [ -f mkvendor.sh ]; then + sh mkvendor.sh +fi + +if [ "$DOWNLOAD" != "UNSUPPORTED" ]; then + for TARBALL in $(basename -a $DOWNLOAD); do + CHECKSUMS="$CHECKSUMS$(md5sum "$TARBALL" | cut -d' ' -f1) " + done + perl -0777 -pi -e 's|MD5SUM="[0-9a-f\s\\]*"|MD5SUM="'"${CHECKSUMS% }"'"|' "$PRGNAM.info" +fi +if [ -n "$DOWNLOAD_x86_64" ] && [ "$DOWNLOAD_x86_64" != "UNSUPPORTED" ]; then + for TARBALL in $(basename -a $DOWNLOAD_x86_64); do + CHECKSUMS64="$CHECKSUMS64$(md5sum "$TARBALL" | cut -d' ' -f1) " + done + perl -0777 -pi -e 's|MD5SUM_x86_64="[0-9a-f\s\\]*"|MD5SUM_x86_64="'"${CHECKSUMS64% }"'"|' "$PRGNAM.info" +fi + +sbofixinfo +rm -f "$PRGNAM.info.bak" + +cd "$CWD"