summaryrefslogtreecommitdiff
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
parent5f0b9a765ca918f0a6b7792b27f7e041399535d9 (diff)
downloadarchlinuxewe-10c4033b29f704bfee9e502c46d88666444a5052.tar.xz
commit-package: status-quo
-rwxr-xr-xbumpPerl4
-rwxr-xr-xbumpPkgrel14
-rwxr-xr-xbumpPython13
-rwxr-xr-xbumpVersion14
-rwxr-xr-xcommit-package32
5 files changed, 40 insertions, 37 deletions
diff --git a/bumpPerl b/bumpPerl
index 7fe82a129..4344ea5e8 100755
--- a/bumpPerl
+++ b/bumpPerl
@@ -35,7 +35,9 @@ for pkgbuild in perl-*/PKGBUILD demeter/PKGBUILD; do
)
' "${pkgbuild}"
fi
- git add "${pkgbuild}"
+ cd "${pkgbuild%/*}"
+ ../commit-package
+ cd ..
done
diff --git a/bumpPkgrel b/bumpPkgrel
index 343474554..54a45a0cd 100755
--- a/bumpPkgrel
+++ b/bumpPkgrel
@@ -143,19 +143,7 @@ else
< 'PKGBUILD' \
| sponge 'PKGBUILD'
if ${commit}; then
- if [ -d '.git' ] || [ -f '.git' ]; then
- makepkg --printsrcinfo > .SRCINFO
- git commit 'PKGBUILD' '.SRCINFO' -m "${pkg}: rebuild"
- for remote in $(
- git remote
- ); do
- git push "${remote}" || exit 1
- done
- cd ..
- git commit "${pkg}" -m "${pkg}: rebuild"
- else
- git commit 'PKGBUILD' -m "${pkg}: rebuild"
- fi
+ ../commit-package "${pkg}: rebuild"
fi
fi
diff --git a/bumpPython b/bumpPython
index c7eb39166..89c45146f 100755
--- a/bumpPython
+++ b/bumpPython
@@ -53,16 +53,9 @@ for pkgbuild in "${pkgbuilds[@]}"; do
s@'"'python>=${pymajor}\.[0-9]\+'@'python>=${pyver}'"'@
s@'"'python<${pymajor}\.[0-9]\+'@'python<${pyverupper}'"'@
' "${pkgbuild}"
- if [ -d "${pkgbuild%/*}"'/.git' ] || [ -f "${pkgbuild%/*}"'/.git' ]; then
- cd "${pkgbuild%/*}"
- makepkg --printsrcinfo > .SRCINFO
- git commit 'PKGBUILD' '.SRCINFO' -m "${pkgbuild%/*}: rebuild against new python ${pyver}"
- git push || exit 1
- cd ..
- git add "${pkgbuild%/*}"
- else
- git add "${pkgbuild}"
- fi
+ cd "${pkgbuild%/*}"
+ ../commit-package
+ cd ..
done
diff --git a/bumpVersion b/bumpVersion
index 5b6371cdb..178ef0163 100755
--- a/bumpVersion
+++ b/bumpVersion
@@ -207,18 +207,6 @@ if [ "${paket}" != 'qgis-git' ]; then
namcap "${pkg}" || exit 1
done
fi
-if [ -d '.git' ] || [ -f '.git' ]; then
- makepkg --printsrcinfo > .SRCINFO
- git commit 'PKGBUILD' '.SRCINFO' -m "${paket} ${pkgver}-${pkgrel} -> ${remVer}-1"
- for remote in $(
- git remote
- ); do
- git push "${remote}" || exit 1
- done
- cd ..
- git commit "${paket}" -m "${paket} ${pkgver}-${pkgrel} -> ${remVer}-1"
-else
- git commit 'PKGBUILD' -m "${paket} ${pkgver}-${pkgrel} -> ${remVer}-1"
-fi
+../commit-package "${paket} ${pkgver}-${pkgrel} -> ${remVer}-1"
>&2 echo '... done'
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