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-2014 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 if [ -d ../metadata ]; then
27 echo "No metadata files found!"
33 [ -z "$line" ] && continue
36 *\?\?*metadata/*.txt) new=true ;;
37 *M*metadata/*.txt) new=false ;;
46 *" $id "*) ;; # Middle
50 *) continue ;; # Missing
54 [ -d metadata/$id ] && extra=metadata/$id || extra=
59 'Auto Name:'*) autoname=${l#*:} ;;
60 'Name:'*) name=${l#*:} ;;
64 if [ -n "$name" ]; then
66 elif [ -n "$autoname" ]; then
73 message="New app: $fullname"
81 *"Maintainer Notes:"*) break ;;
82 "-Build:"*) onlybuild=false ;;
84 $newbuild && onlybuild=false
92 $newbuild && $onlybuild && disable=true
96 $(git diff HEAD -- "$file")
99 if $newbuild && $onlybuild; then
101 message="Don't update $fullname to $version ($vercode)"
103 message="Update $fullname to $version ($vercode)"
110 message=${message//\"/\\\"}
111 commands="$commands%%git add -- $file $extra && git commit -m \"$message\" -e -v"
114 $(git status --porcelain metadata)
117 [ -z "$commands" ] && exit 0
121 for cmd in $commands; do
122 [ -z "$cmd" ] && continue