summaryrefslogtreecommitdiff
path: root/commit-package
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-12-02 21:48:07 +0100
committerErich Eckner <git@eckner.net>2020-12-02 21:48:07 +0100
commit10c4033b29f704bfee9e502c46d88666444a5052 (patch)
treed7abe284a85a83d2a1835a272f0e5e50a9f8fb52 /commit-package
parent5f0b9a765ca918f0a6b7792b27f7e041399535d9 (diff)
downloadarchlinuxewe.git.save-10c4033b29f704bfee9e502c46d88666444a5052.tar.xz
commit-package: status-quo
Diffstat (limited to 'commit-package')
-rwxr-xr-xcommit-package32
1 files changed, 32 insertions, 0 deletions
diff --git a/commit-package b/commit-package
new file mode 100755
index 00000000..b742d915
--- /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