diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-03-07 14:29:03 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-03-07 14:29:03 +0100 |
commit | e85e4f8e7096fdeffb2b5920c848a0fce600b9ef (patch) | |
tree | c2bd02c3c6fbb52ecfa1a1b4bb9184d0f206d34d /xrevbump | |
parent | 58e094786e4bdece2957d9f5c29a7445d08ae225 (diff) | |
download | xtools-e85e4f8e7096fdeffb2b5920c848a0fce600b9ef.tar.gz xtools-e85e4f8e7096fdeffb2b5920c848a0fce600b9ef.tar.xz xtools-e85e4f8e7096fdeffb2b5920c848a0fce600b9ef.zip |
add xrevbump
Diffstat (limited to 'xrevbump')
-rwxr-xr-x | xrevbump | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/xrevbump b/xrevbump new file mode 100755 index 0000000..29b8f8b --- /dev/null +++ b/xrevbump @@ -0,0 +1,31 @@ +#!/bin/bash +# xrevbump MESSAGE TEMPLATES... - increase template revision and commit + +MESSAGE=$1 +shift + +if [ $# -eq 0 ]; then + printf "Usage: xrevbump MESSAGE TEMPLATES...\n" 2>&1 + exit 1 +fi + +for t; do + if [ -f "$t" ]; then + : + elif [ -f "$t/template" ]; then + t="$t/template" + elif [ -f "srcpkgs/$t/template" ]; then + t="srcpkgs/$t/template" + else + printf "Cannot find template '%s'\n" "$t" + break + fi + + . "$t" + + revision=$((revision + 1)) + printf "%s: bump to revision %d\n" "$t" "$revision" + + sed -i -e "/^revision=/s/=.*/=$revision/" "$t" + git -C "${t%/*}" commit -m "$pkgname: $MESSAGE" template +done |