mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-14 02:50:12 +01:00
Merge branch 'master' into verbose-rewrite
This commit is contained in:
commit
223b0ea061
@ -5,21 +5,21 @@
|
|||||||
# 'fdroid' is aliased automatically, but aliases to it are not. For instance,
|
# 'fdroid' is aliased automatically, but aliases to it are not. For instance,
|
||||||
# to alias 'fd' to 'fdroid' and have competion available:
|
# to alias 'fd' to 'fdroid' and have competion available:
|
||||||
#
|
#
|
||||||
# alias fd='fdroid'
|
# alias fd='fdroid'
|
||||||
# complete -F _fdroid fd
|
# complete -F _fdroid fd
|
||||||
#
|
#
|
||||||
# One can use completion on aliased subcommands as follows:
|
# One can use completion on aliased subcommands as follows:
|
||||||
#
|
#
|
||||||
# alias fbuild='fdroid build'
|
# alias fbuild='fdroid build'
|
||||||
# complete -F _fdroid_build fbuild
|
# complete -F _fdroid_build fbuild
|
||||||
#
|
#
|
||||||
# There are also completion function for '-p com.some.app' aliases:
|
# There are also completion function for '-p com.some.app' aliases:
|
||||||
#
|
#
|
||||||
# alias fbld='fdroid build -v -l -p'
|
# alias fbld='fdroid build -v -l -p'
|
||||||
# complete -F _fdroid_build_project fbld
|
# complete -F _fdroid_build_project fbld
|
||||||
#
|
#
|
||||||
# alias fcheckup='fdroid checkupdates -v -p'
|
# alias fcheckup='fdroid checkupdates -v -p'
|
||||||
# complete -F _fdroid_checkupdates_project fcheckup
|
# complete -F _fdroid_checkupdates_project fcheckup
|
||||||
#
|
#
|
||||||
# This way, one can simply do 'fbld com.some.app' or 'fcheckup com.some.app'
|
# This way, one can simply do 'fbld com.some.app' or 'fcheckup com.some.app'
|
||||||
|
|
||||||
@ -217,6 +217,11 @@ _fdroid_checkupdates_project() {
|
|||||||
__complete_checkupdates
|
__complete_checkupdates
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_fd-commit() {
|
||||||
|
__package
|
||||||
|
}
|
||||||
|
|
||||||
complete -F _fdroid fdroid
|
complete -F _fdroid fdroid
|
||||||
|
complete -F _fd-commit fd-commit
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
62
fd-commit
62
fd-commit
@ -5,41 +5,55 @@
|
|||||||
commands=()
|
commands=()
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
if [[ "$line" == *M*metadata/*.txt ]]; then
|
if [[ "$line" == *M*metadata/*.txt ]]; then
|
||||||
file=${line##* }
|
file=${line##* }
|
||||||
|
|
||||||
|
id=${file##*/}
|
||||||
|
id=${id%.txt*}
|
||||||
|
if [ $# -gt 0 ]; then
|
||||||
|
found=false
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [ "$id" == "$arg" ]; then
|
||||||
|
found=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
$found || continue
|
||||||
|
fi
|
||||||
|
|
||||||
while read l; do
|
[ -d metadata/$id ] && extra=metadata/$id
|
||||||
[[ "$l" == "Auto Name:"* ]] && name=${l##*:}
|
|
||||||
done < "$file"
|
|
||||||
|
|
||||||
id=${file##*/}
|
while read l; do
|
||||||
id=${id%.txt*}
|
if [[ "$l" == "Auto Name:"* ]]; then
|
||||||
[ -d metadata/$id ] && extra=metadata/$id
|
name=${l##*:}
|
||||||
[ -n "$name" ] && id="$name ($id)"
|
break
|
||||||
|
fi
|
||||||
|
done < "$file"
|
||||||
|
|
||||||
newbuild=0
|
[ -n "$name" ] && id="$name ($id)"
|
||||||
while read l; do
|
|
||||||
if [[ "$l" == "+Build:"* ]]; then
|
|
||||||
newbuild=1
|
|
||||||
build=${l#*:}
|
|
||||||
version=${build%%,*}
|
|
||||||
build=${build#*,}
|
|
||||||
vercode=${build%%,*}
|
|
||||||
fi
|
|
||||||
done < <(git diff HEAD -- "$file")
|
|
||||||
|
|
||||||
if [ $newbuild -eq 0 ]
|
newbuild=0
|
||||||
then
|
while read l; do
|
||||||
|
if [[ "$l" == "+Build:"* ]]; then
|
||||||
|
newbuild=1
|
||||||
|
build=${l#*:}
|
||||||
|
version=${build%%,*}
|
||||||
|
build=${build#*,}
|
||||||
|
vercode=${build%%,*}
|
||||||
|
fi
|
||||||
|
done < <(git diff HEAD -- "$file")
|
||||||
|
|
||||||
|
if [ $newbuild -eq 0 ]; then
|
||||||
message="$id:"
|
message="$id:"
|
||||||
else
|
else
|
||||||
message="Update $id to $version ($vercode)"
|
message="Update $id to $version ($vercode)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
commands+=("git commit -m '$message' -e -v -- $file $extra")
|
commands+=("git commit -m '$message' -e -v -- $file $extra")
|
||||||
fi
|
fi
|
||||||
done < <(git status --porcelain)
|
done < <(git status --porcelain)
|
||||||
|
|
||||||
for cmd in "${commands[@]}"; do
|
for cmd in "${commands[@]}"; do
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user