diff options
author | Parabola git <git@parabola.nu> | 2020-11-12 07:00:02 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2020-11-12 07:00:02 +0000 |
commit | 5f66754b2ff9d6fe3f47e0d6e5d93c3fd4d58717 (patch) | |
tree | 0e96b742b629e4dfafc532a85d95d990857d91b0 | |
parent | e2d92a6a5c5e40cf074bcc45b40860bda3349807 (diff) |
Update from cron
l--------- | abslibre/abslibre.git/hooks/.#commit-msg | 1 | ||||
-rwxr-xr-x | abslibre/abslibre.git/hooks/commit-msg | 25 |
2 files changed, 16 insertions, 10 deletions
diff --git a/abslibre/abslibre.git/hooks/.#commit-msg b/abslibre/abslibre.git/hooks/.#commit-msg deleted file mode 120000 index 9772bb8..0000000 --- a/abslibre/abslibre.git/hooks/.#commit-msg +++ /dev/null @@ -1 +0,0 @@ -root@winston.parabola.nu.1971724
\ No newline at end of file diff --git a/abslibre/abslibre.git/hooks/commit-msg b/abslibre/abslibre.git/hooks/commit-msg index 30a4595..139c4d6 100755 --- a/abslibre/abslibre.git/hooks/commit-msg +++ b/abslibre/abslibre.git/hooks/commit-msg @@ -4,19 +4,26 @@ set -e #readonly REBUILD_PKGS=( # libre/lxappearance-obconf-gtk3 #) - - -# rebuild/sign per autobuilder #for pkg in ${REBUILD_PKGS[@]} #do echo '==> Rebuilding ${pkg} ...' # ~autobuilder/.local/bin/autobuild ${pkg} #done -commit_msg_file="$@" -if [[ "$(cat ${commit_msg_file})" =~ ^\[([^/]*/[^/]*)\]: *autobuild$ ]] -then pkg=${BASH_REMATCH[1]} - if git ls-tree --name-only -r master | grep "${pkg}/PKGBUILD" + + +commit_msg_file="$1" +commit_msg="$(cat ${commit_msg_file})" +autobuild_rx='^\[([^/]*/[^/]*)\]: *autobuild$' # eg: '[pcr/foo]:autobuild' + +# auto-rebuild and reject push +[[ "${commit_msg}" =~ "${autobuild_rx}" ]] || exit 0 + +if [[ "${commit_msg}" =~ "${autobuild_rx}" ]] +then repo_pkg="${BASH_REMATCH[1]}" + if git ls-tree --name-only -r master | grep "^${repo_pkg}/PKGBUILD$" # &> /dev/null then echo '==> Rebuilding ${pkg} ...' - ~autobuilder/.local/bin/autobuild ${pkg} - exit 1 + if ~autobuilder/.local/bin/autobuild ${repo_pkg} + then exit 1 + else echo "${commit_msg} - autobuild failed" > ${commit_msg_file} + fi fi fi |