From: Daniel Martí Date: Wed, 30 Oct 2013 19:17:56 +0000 (+0100) Subject: commitupdates now treats all other changes in a generic manner X-Git-Tag: 0.1~272 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=355dabc43efd51013d5bd6dfa2d0725180168bdd;p=fdroidserver.git commitupdates now treats all other changes in a generic manner --- diff --git a/tools/commitupdates b/tools/commitupdates index bd448003..e1445a47 100755 --- a/tools/commitupdates +++ b/tools/commitupdates @@ -8,15 +8,18 @@ while read line; do if [[ "$line" == *M*metadata/*.txt ]]; then file=${line##* } + while read l; do + [[ "$l" == "Auto Name:"* ]] && name=${l##*:} + done < "$file" + + id=${file##*/} + id=${id%.txt*} + [ -d metadata/$id ] && extra=metadata/$id + [ -n "$name" ] && id="$name ($id)" + newbuild=0 while read l; do - if [[ "$l" == "+Build Version:"* ]]; then - newbuild=1 - build=${l#*:} - version=${build%%,*} - build=${build#*,} - vercode=${build%%,*} - elif [[ "$l" == "+Build:"* ]]; then + if [[ "$l" == "+Build:"* ]]; then newbuild=1 build=${l#*:} version=${build%%,*} @@ -25,18 +28,14 @@ while read line; do fi done < <(git diff HEAD -- "$file") - [ $newbuild -eq 0 ] && continue - - while read l; do - [[ "$l" == "Auto Name:"* ]] && name=${l##*:} - done < "$file" - - id=${file##*/} - id=${id%.txt*} - [ -d metadata/$id ] && extra=metadata/$id - [ -n "$name" ] && id="$name ($id)" + if [ $newbuild -eq 0 ] + then + message="$id:" + else + message="Update $id to $version ($vercode)" + fi - commands+=("git commit -m 'Update $id to $version ($vercode)' -e -v -- $file $extra") + commands+=("git commit -m '$message' -e -v -- $file $extra") fi done < <(git status --porcelain)