From e0290e7d93fecf766feee20d1bb78d72aa808651 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Tue, 25 Jul 2023 11:40:31 +0800 Subject: [PATCH] checknupdate: make it more reliable cdn seems to update slower these days and checksum is likely to fail due to no file when feed update observed --- checknupdate.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/checknupdate.sh b/checknupdate.sh index e978272..4d4e6b5 100755 --- a/checknupdate.sh +++ b/checknupdate.sh @@ -1,4 +1,7 @@ -#!/bin/bash +#!/bin/sh + +set -e + git pull --no-edit VER=$(grep '^pkgver=' APKBUILD | cut -d '=' -f 2) @@ -20,11 +23,12 @@ if [ ! -n "$NEW_SUBLEVEL" ];then exit 0 fi -if [ "$NEW_SUBLEVEL" -gt "$CURR_SUBLEVEL" ];then +(if [ "$NEW_SUBLEVEL" -gt "$CURR_SUBLEVEL" ];then echo "Update: $CURR_BRANCH.$CURR_SUBLEVEL -> $CURR_BRANCH.$NEW_SUBLEVEL" sed "s/pkgver=$VER/pkgver=$CURR_BRANCH.$NEW_SUBLEVEL/" -i APKBUILD SED_ERRNO=$? - abuild checksum && apkgrel -z APKBUILD + abuild checksum + apkgrel -z APKBUILD git add APKBUILD if [ "$SED_ERRNO" -eq 0 ];then git commit -m "Auto Update: $CURR_BRANCH.$CURR_SUBLEVEL -> $CURR_BRANCH.$NEW_SUBLEVEL" @@ -32,4 +36,4 @@ if [ "$NEW_SUBLEVEL" -gt "$CURR_SUBLEVEL" ];then git commit -m "[FAILED] Auto Update: $CURR_BRANCH.$CURR_SUBLEVEL -> $CURR_BRANCH.$NEW_SUBLEVEL" fi git push -fi +fi) || git reset --hard -- 2.45.2