summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-12-07 14:11:28 +0100
committerErich Eckner <git@eckner.net>2020-12-07 14:11:28 +0100
commit44ee3a3d018cc5402fc40773c672b165355214ab (patch)
tree23b519c4b12b6e91b09953b029f2730974147e31
parent9b1d81183a71fc34412e012feaf85d54b7a53921 (diff)
downloadarchlinuxewe-44ee3a3d018cc5402fc40773c672b165355214ab.tar.xz
commit-package: fix rebase stuff and branches
-rwxr-xr-xcommit-package42
1 files changed, 40 insertions, 2 deletions
diff --git a/commit-package b/commit-package
index 9b50d13aa..70f0229d1 100755
--- a/commit-package
+++ b/commit-package
@@ -2,6 +2,20 @@
set -e
+pdiff () {
+ local one="$1";
+ local two="$2";
+ local pipe="$3";
+ shift 3;
+ diff "$@" <(
+ cat "$one" \
+ | bash -c "$pipe"
+ ) <(
+ cat "$two" \
+ | bash -c "$pipe"
+ )
+}
+
unset commit_message
if [ $# -eq 1 ]; then
commit_message="$1"
@@ -34,12 +48,36 @@ if [ -d '.git' ] || [ -f '.git' ]; then
makepkg --printsrcinfo > .SRCINFO
git commit 'PKGBUILD' '.SRCINFO' -m "${commit_message:-rebuild}"
git checkout master
- git diff archlinuxewe{^,} \
+ diff=$(
+ git diff archlinuxewe{^,} --name-status \
+ | cut -f2 \
+ | grep -vxF .SRCINFO \
+ | grep -vxF PKGBUILD \
+ | xargs -r git diff archlinuxewe{^,} --
+ )
+ if [ -n "${diff}" ]; then
+ printf '%s\n' "${diff}" \
+ | git apply
+ fi
+ pdiff <(
+ git archive archlinuxewe^ -- PKGBUILD
+ ) <(
+ git archive archlinuxewe -- PKGBUILD
+ ) '
+ tar -Ox \
+ | sed "
+ /^_pinned_dependencies=(/,/)/d
+ "
+ ' -u \
+ | sed '
+ s@^\(---\|+++\) /dev/fd/\S\+\s\+@\1 a/PKGBUILD @
+ ' \
| git apply
+ makepkg --printsrcinfo > .SRCINFO
git commit 'PKGBUILD' '.SRCINFO' -m "${commit_message:-rebuild}"
git push aur
git checkout archlinuxewe
- git rebase aur
+ git rebase master
git push ecknernet
cd ..
if [ -n "${commit_message}" ]; then