fdroid publish now includes OTA ZIPs and related source

This adds support for publishing ZIP files which were built with
`fdroid build`.  This is for "Over-The-Air" (OTA) update ZIP files for
flashing to ROMs.  The first example of this is the Privileged Extension,
which must be installed by flashing an OTA ZIP on Android > 5.0.

!181
https://gitlab.com/fdroid/privileged-extension/issues/9
https://gitlab.com/fdroid/privileged-extension/issues/10
https://gitlab.com/fdroid/fdroiddata/merge_requests/1804

Also, "if app.Binaries:" is the same as "if app.Binaries is not None:", but
is the standard Python style.
This commit is contained in:
Hans-Christoph Steiner 2016-12-07 11:48:05 +01:00
parent 0eea26753a
commit bc27dee950
4 changed files with 18 additions and 11 deletions

View file

@ -460,7 +460,7 @@ def has_extension(filename, ext):
return ext == f_ext
apk_regex = re.compile(r"^(.+)_([0-9]+)\.apk$")
publish_name_regex = re.compile(r"^(.+)_([0-9]+)\.(apk|zip)$")
def clean_description(description):
@ -476,13 +476,13 @@ def clean_description(description):
return returnstring.rstrip('\n')
def apknameinfo(filename):
def publishednameinfo(filename):
filename = os.path.basename(filename)
m = apk_regex.match(filename)
m = publish_name_regex.match(filename)
try:
result = (m.group(1), m.group(2))
except AttributeError:
raise FDroidException("Invalid apk name: %s" % filename)
raise FDroidException("Invalid name for published file: %s" % filename)
return result