3 # fd-commit - part of the FDroid server tools
4 # Commits updates to apps, allowing you to edit the commit messages
6 # Copyright (C) 2013 Daniel Martà <mvdan@mvdan.cc>
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Affero General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU Affero General Public License for more details.
18 # You should have received a copy of the GNU Affero General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23 if [ ! -d metadata ]; then
24 [ -d ../metadata ] && cd .. || { echo "No metadata files found!"; exit 2; }
28 if [[ "$line" == *M*metadata/*.txt ]]; then
36 if [ "$id" == "$arg" ]; then
44 if [ -d metadata/$id ]; then
52 if [[ "$l" == "Auto Name:"* ]]; then
54 elif [[ "$l" == "Name:"* ]]; then
59 if [ -n "$name" ]; then
60 fullname="$name ($id)"
61 elif [ -n "$autoname" ]; then
62 fullname="$autoname ($id)"
69 if [[ "$l" == "+Build:"* ]]; then
76 done < <(git diff HEAD -- "$file")
78 if [ $newbuild -eq 0 ]; then
81 message="Update $fullname to $version ($vercode)"
84 commands+=("git commit -m '$message' -e -v -- $file $extra")
86 done < <(git status --porcelain)
88 for cmd in "${commands[@]}"; do