1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-06 11:00:13 +02:00
fdroidserver/fd-commit

46 lines
1.0 KiB
Plaintext
Raw Normal View History

2013-06-18 00:18:38 +02:00
#!/bin/bash
2013-09-18 00:11:35 +02:00
# Commits updates to apps, allowing you to edit the commit messages
commands=()
2013-06-18 00:18:38 +02:00
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)"
2013-06-18 00:18:38 +02:00
newbuild=0
while read l; do
if [[ "$l" == "+Build:"* ]]; then
newbuild=1
build=${l#*:}
version=${build%%,*}
build=${build#*,}
vercode=${build%%,*}
2013-06-18 00:18:38 +02:00
fi
2013-06-27 21:32:06 +02:00
done < <(git diff HEAD -- "$file")
2013-06-18 00:18:38 +02:00
if [ $newbuild -eq 0 ]
then
message="$id:"
else
message="Update $id to $version ($vercode)"
fi
commands+=("git commit -m '$message' -e -v -- $file $extra")
2013-06-18 00:18:38 +02:00
fi
done < <(git status --porcelain)
2013-07-02 14:39:56 +02:00
for cmd in "${commands[@]}"; do
eval "$cmd"
done