summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Alex2021-08-25 09:59:56 +1000
committerBen Alex2021-08-25 09:59:56 +1000
commit170464c63fb5a5a289ce7ec967646a4212fba48d (patch)
treec4e38d96c59bd6a6cd2bb5b32eadea19320be741
parente340ad95568d1d313a57600fc526d0f680dc4f3f (diff)
downloadaur-170464c63fb5a5a289ce7ec967646a4212fba48d.tar.gz
Enhance update/upload script error detection
-rwxr-xr-xupdate1
-rwxr-xr-xupload10
2 files changed, 10 insertions, 1 deletions
diff --git a/update b/update
index f67e58383fe..70baee79b68 100755
--- a/update
+++ b/update
@@ -45,6 +45,7 @@ else
makepkg -rs
if ! ls *.zst &> /dev/null ; then
echo "Package creation failure"
+ sed -i "s/pkgver=.*/pkgver=INVALID/" PKGBUILD
exit 2
fi
makepkg --printsrcinfo > .SRCINFO
diff --git a/upload b/upload
index f94e94cb7b5..dc84dee95c8 100755
--- a/upload
+++ b/upload
@@ -14,10 +14,18 @@ done
SCRIPT_HOME=`dirname "$PRG"`
$SCRIPT_HOME/update
-if [ "$?" -eq 1 ]; then
+EXIT_CODE=$?
+if [ $EXIT_CODE -eq 0 ]; then
+ echo "Package is already up to date"
+ exit 0
+elif [ $EXIT_CODE -eq 1 ]; then
+ set -e
echo "Updating Git"
cd $SCRIPT_HOME
ver="$(grep pkgver= PKGBUILD | sed 's/.*=//g')"
git commit -a -m "Update to $ver"
git push
+elif [ $EXIT_CODE -eq 2 ]; then
+ echo "update script failed with exit code 2"
+ exit 2
fi