mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
fd-commit can now take app ids as filter; retab
This commit is contained in:
parent
e069da3562
commit
8acbc33f0d
2 changed files with 46 additions and 32 deletions
|
|
@ -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'
|
||||||
|
|
||||||
|
|
|
||||||
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##* }
|
||||||
|
|
||||||
while read l; do
|
id=${file##*/}
|
||||||
[[ "$l" == "Auto Name:"* ]] && name=${l##*:}
|
id=${id%.txt*}
|
||||||
done < "$file"
|
if [ $# -gt 0 ]; then
|
||||||
|
found=false
|
||||||
|
for arg in "$@"; do
|
||||||
|
if [ "$id" == "$arg" ]; then
|
||||||
|
found=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
$found || continue
|
||||||
|
fi
|
||||||
|
|
||||||
id=${file##*/}
|
[ -d metadata/$id ] && extra=metadata/$id
|
||||||
id=${id%.txt*}
|
|
||||||
[ -d metadata/$id ] && extra=metadata/$id
|
|
||||||
[ -n "$name" ] && id="$name ($id)"
|
|
||||||
|
|
||||||
newbuild=0
|
while read l; do
|
||||||
while read l; do
|
if [[ "$l" == "Auto Name:"* ]]; then
|
||||||
if [[ "$l" == "+Build:"* ]]; then
|
name=${l##*:}
|
||||||
newbuild=1
|
break
|
||||||
build=${l#*:}
|
fi
|
||||||
version=${build%%,*}
|
done < "$file"
|
||||||
build=${build#*,}
|
|
||||||
vercode=${build%%,*}
|
|
||||||
fi
|
|
||||||
done < <(git diff HEAD -- "$file")
|
|
||||||
|
|
||||||
if [ $newbuild -eq 0 ]
|
[ -n "$name" ] && id="$name ($id)"
|
||||||
then
|
|
||||||
|
newbuild=0
|
||||||
|
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…
Add table
Add a link
Reference in a new issue