mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Make app and version name formats a standard
This commit is contained in:
parent
bf61dcf708
commit
996f141da8
3 changed files with 30 additions and 14 deletions
12
fd-commit
12
fd-commit
|
|
@ -27,15 +27,21 @@ while read line; do
|
||||||
|
|
||||||
[ -d metadata/$id ] && extra=metadata/$id
|
[ -d metadata/$id ] && extra=metadata/$id
|
||||||
|
|
||||||
name=
|
|
||||||
while read l; do
|
while read l; do
|
||||||
if [[ "$l" == "Auto Name:"* ]]; then
|
if [[ "$l" == "Auto Name:"* ]]; then
|
||||||
|
autoname=${l##*:}
|
||||||
|
elif [[ "$l" == "Name:"* ]]; then
|
||||||
name=${l##*:}
|
name=${l##*:}
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
done < "$file"
|
done < "$file"
|
||||||
|
|
||||||
[ -n "$name" ] && fullname="$name ($id)" || fullname=$id
|
if [ -n "$name" ]; then
|
||||||
|
fullname="$name ($id)"
|
||||||
|
elif [ -n "$autoname" ]; then
|
||||||
|
fullname="$autoname ($id)"
|
||||||
|
else
|
||||||
|
fullname="$id"
|
||||||
|
fi
|
||||||
|
|
||||||
newbuild=0
|
newbuild=0
|
||||||
while read l; do
|
while read l; do
|
||||||
|
|
|
||||||
|
|
@ -309,17 +309,17 @@ def main():
|
||||||
version, reason = check_gplay(app)
|
version, reason = check_gplay(app)
|
||||||
if version is None and options.verbose:
|
if version is None and options.verbose:
|
||||||
if reason == '404':
|
if reason == '404':
|
||||||
print "%s (%s) is not in the Play Store" % (app['Auto Name'], app['id'])
|
print "%s is not in the Play Store" % common.getappname(app)
|
||||||
else:
|
else:
|
||||||
print "%s (%s) encountered a problem: %s" % (app['Auto Name'], app['id'], reason)
|
print "%s encountered a problem: %s" % common.getappname(app)
|
||||||
if version is not None:
|
if version is not None:
|
||||||
stored = app['Current Version']
|
stored = app['Current Version']
|
||||||
if LooseVersion(stored) < LooseVersion(version):
|
if LooseVersion(stored) < LooseVersion(version):
|
||||||
print "%s (%s) has version %s on the Play Store, which is bigger than %s" % (
|
print "%s has version %s on the Play Store, which is bigger than %s" % (
|
||||||
app['Auto Name'], app['id'], version, stored)
|
common.getappname(app), version, stored)
|
||||||
elif options.verbose:
|
elif options.verbose:
|
||||||
print "%s (%s) has the same version %s on the Play Store" % (
|
print "%s has the same version %s on the Play Store" % (
|
||||||
app['Auto Name'], app['id'], version)
|
common.getappname(app), version)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -409,9 +409,9 @@ def main():
|
||||||
print "ERROR: Auto Name or Current Version failed for %s due to exception: %s" % (app['id'], traceback.format_exc())
|
print "ERROR: Auto Name or Current Version failed for %s due to exception: %s" % (app['id'], traceback.format_exc())
|
||||||
|
|
||||||
if updating:
|
if updating:
|
||||||
print '...updating to version %s (%s)' % (app['Current Version'], app['Current Version Code'])
|
print '...updating to version %s' % ver
|
||||||
name = '%s (%s)' % (app['Auto Name'], app['id']) if app['Auto Name'] else app['id']
|
name = common.getappname(app)
|
||||||
ver = "%s (%s)" % (app['Current Version'], app['Current Version Code'])
|
ver = common.getcvname(app)
|
||||||
logmsg = 'Update CV of %s to %s' % (name, ver)
|
logmsg = 'Update CV of %s to %s' % (name, ver)
|
||||||
|
|
||||||
if options.auto:
|
if options.auto:
|
||||||
|
|
@ -445,8 +445,8 @@ def main():
|
||||||
newbuild['commit'] = commit
|
newbuild['commit'] = commit
|
||||||
app['builds'].append(newbuild)
|
app['builds'].append(newbuild)
|
||||||
writeit = True
|
writeit = True
|
||||||
name = "%s (%s)" % (app['Auto Name'], app['id']) if app['Auto Name'] else app['id']
|
name = common.getappname(app)
|
||||||
ver = "%s (%s)" % (newbuild['version'], newbuild['vercode'])
|
ver = common.getcvname(app)
|
||||||
logmsg = "Update %s to %s" % (name, ver)
|
logmsg = "Update %s to %s" % (name, ver)
|
||||||
else:
|
else:
|
||||||
print 'Invalid auto update mode'
|
print 'Invalid auto update mode'
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,16 @@ def getapkname(app, build):
|
||||||
def getsrcname(app, build):
|
def getsrcname(app, build):
|
||||||
return "%s_%s_src.tar.gz" % (app['id'], build['vercode'])
|
return "%s_%s_src.tar.gz" % (app['id'], build['vercode'])
|
||||||
|
|
||||||
|
def getappname(app):
|
||||||
|
if app['Name']:
|
||||||
|
return '%s (%s)' % (app['Name'], app['id'])
|
||||||
|
if app['Auto Name']:
|
||||||
|
return '%s (%s)' % (app['Auto Name'], app['id'])
|
||||||
|
return app['id']
|
||||||
|
|
||||||
|
def getcvname(app):
|
||||||
|
return '%s (%s)' % (app['Current Version'], app['Current Version Code'])
|
||||||
|
|
||||||
def getvcs(vcstype, remote, local):
|
def getvcs(vcstype, remote, local):
|
||||||
if vcstype == 'git':
|
if vcstype == 'git':
|
||||||
return vcs_git(remote, local)
|
return vcs_git(remote, local)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue