From 10c4033b29f704bfee9e502c46d88666444a5052 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 2 Dec 2020 21:48:07 +0100 Subject: commit-package: status-quo --- commit-package | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 commit-package (limited to 'commit-package') diff --git a/commit-package b/commit-package new file mode 100755 index 000000000..b742d915f --- /dev/null +++ b/commit-package @@ -0,0 +1,32 @@ +#!/bin/bash + +unset commit_message +if [ $# -eq 1 ]; then + commit_message="$1" +elif [ $# -ne 0 ]; then + >&2 'usage: commit-package [commit-message]' + >&2 ' without a commit message, it will only be added for commit' + exit 1 +fi + +if [ -d '.git' ] || [ -f '.git' ]; then + makepkg --printsrcinfo > .SRCINFO + git commit 'PKGBUILD' '.SRCINFO' -m "${commit_message:-rebuild}" + for remote in $( + git remote + ); do + git push "${remote}" || exit 1 + done + cd .. + if [ -n "${commit_message}" ]; then + git commit "${paket}" -m "${commit_message}" + else + git add "${paket}" + fi +else + if [ -n "${commit_message}" ]; then + git commit 'PKGBUILD' -m "${commit_message}" + else + git add 'PKGBUILD' + fi +fi -- cgit v1.2.3-70-g09d2