mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 23:40:29 +03:00
Add support for new files
This commit is contained in:
parent
a0dbddc6da
commit
83557583cb
1 changed files with 41 additions and 34 deletions
75
fd-commit
75
fd-commit
|
|
@ -30,41 +30,48 @@ if [ ! -d metadata ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
if [[ "$line" == *M*metadata/*.txt ]]; then
|
if [[ "$line" == *??*metadata/*.txt ]]; then
|
||||||
file=${line##* }
|
new=true
|
||||||
|
elif [[ "$line" == *M*metadata/*.txt ]]; then
|
||||||
|
new=false
|
||||||
|
fi
|
||||||
|
file=${line##* }
|
||||||
|
|
||||||
id=${file##*/}
|
id=${file##*/}
|
||||||
id=${id%.txt*}
|
id=${id%.txt*}
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
found=false
|
found=false
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [ "$id" == "$arg" ]; then
|
if [ "$id" == "$arg" ]; then
|
||||||
found=true
|
found=true
|
||||||
break
|
break
|
||||||
fi
|
|
||||||
done
|
|
||||||
$found || continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -d metadata/$id ] && extra=metadata/$id || extra=
|
|
||||||
|
|
||||||
name= autoname=
|
|
||||||
while read l; do
|
|
||||||
if [[ "$l" == "Auto Name:"* ]]; then
|
|
||||||
autoname=${l#*:}
|
|
||||||
elif [[ "$l" == "Name:"* ]]; then
|
|
||||||
name=${l#*:}
|
|
||||||
fi
|
fi
|
||||||
done < "$file"
|
done
|
||||||
|
$found || continue
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$name" ]; then
|
[ -d metadata/$id ] && extra=metadata/$id || extra=
|
||||||
fullname="$name"
|
|
||||||
elif [ -n "$autoname" ]; then
|
name= autoname=
|
||||||
fullname="$autoname"
|
while read l; do
|
||||||
else
|
if [[ "$l" == "Auto Name:"* ]]; then
|
||||||
fullname="$id"
|
autoname=${l#*:}
|
||||||
|
elif [[ "$l" == "Name:"* ]]; then
|
||||||
|
name=${l#*:}
|
||||||
fi
|
fi
|
||||||
|
done < "$file"
|
||||||
|
|
||||||
|
if [ -n "$name" ]; then
|
||||||
|
fullname="$name"
|
||||||
|
elif [ -n "$autoname" ]; then
|
||||||
|
fullname="$autoname"
|
||||||
|
else
|
||||||
|
fullname="$id"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $new; then
|
||||||
|
message="New app: $fullname"
|
||||||
|
else
|
||||||
onlybuild=true
|
onlybuild=true
|
||||||
newbuild=false
|
newbuild=false
|
||||||
disable=false
|
disable=false
|
||||||
|
|
@ -97,11 +104,11 @@ while read line; do
|
||||||
else
|
else
|
||||||
message="$fullname:"
|
message="$fullname:"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
message=${message//\"/\\\"}
|
|
||||||
commands+=("git add -- $file $extra && git commit -m \"$message\" -e -v")
|
|
||||||
fi
|
fi
|
||||||
done < <(git status --porcelain)
|
|
||||||
|
message=${message//\"/\\\"}
|
||||||
|
commands+=("git add -- $file $extra && git commit -m \"$message\" -e -v")
|
||||||
|
done < <(git status --porcelain metadata)
|
||||||
|
|
||||||
[[ -z $commands ]] && exit 0
|
[[ -z $commands ]] && exit 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue