From 8a72d2055709a9363dcdb1527681ca86551ca7dd Mon Sep 17 00:00:00 2001 From: Archlinux-Jerry Build Bot Date: Wed, 23 Oct 2019 21:26:45 +0800 Subject: [PATCH] change: update hook for linux-phicomm-n1 --- linux-phicomm-n1/autobuild.yaml | 2 +- .../update.sh} | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) rename linux-phicomm-n1/{buildbot.update.sh => buildbot.update.d/update.sh} (84%) mode change 100644 => 100755 diff --git a/linux-phicomm-n1/autobuild.yaml b/linux-phicomm-n1/autobuild.yaml index cbb0190..2f00e07 100644 --- a/linux-phicomm-n1/autobuild.yaml +++ b/linux-phicomm-n1/autobuild.yaml @@ -7,7 +7,7 @@ priority: extra: - update: - rm -rf 'src' - - bash buildbot.update.sh + - bash buildbot.update.d/update.sh - failure: - rm -rf 'src_fail' - mv 'src' 'src_fail' diff --git a/linux-phicomm-n1/buildbot.update.sh b/linux-phicomm-n1/buildbot.update.d/update.sh old mode 100644 new mode 100755 similarity index 84% rename from linux-phicomm-n1/buildbot.update.sh rename to linux-phicomm-n1/buildbot.update.d/update.sh index fe73371..5c4e30a --- a/linux-phicomm-n1/buildbot.update.sh +++ b/linux-phicomm-n1/buildbot.update.d/update.sh @@ -1,8 +1,16 @@ #!/bin/bash -# buildbot update hook +# buildbot update hook for kernel packages set -e -o pipefail +assertPkgname() { + if [[ "$(basename $(pwd))" != "$PKGNAME" ]]; then + echo "Please run this script inside the $PKGNAME dir." + exit 1 + fi +} + ## This section does essential preparations +PKGNAME='linux-phicomm-n1' && assertPkgname PKGBUILD='PKGBUILD' git pull --ff-only git checkout $PKGBUILD @@ -54,5 +62,5 @@ pkgrel=$(source $PKGBUILD; echo $pkgrel) [ "$pkgrel" != '1' ] && echo "unexpected pkgrel: ${pkgrel}" >&2 && exit 1 updpkgsums git add $PKGBUILD -git commit -m "autoupdate: linux-phicomm-n1 to ${pkgver}" +git commit -m "autoupdate: ${PKGNAME} to ${pkgver}" git push