1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-20 13:50:12 +01:00

Introduce disable= as a better way of disabling a build

Prefixing commit ID with ! and a message will still work, but that's
very silly. Using disable= is now the correct way.
This commit is contained in:
Ciaran Gultnieks 2013-10-26 10:26:47 +01:00
parent 2aafda0154
commit 715035a707
4 changed files with 17 additions and 15 deletions

View File

@ -746,21 +746,23 @@ The above specifies to build version 0.12, which has a version code of 3.
The third parameter specifies the tag, commit or revision number from The third parameter specifies the tag, commit or revision number from
which to build it in the source repository. which to build it in the source repository.
If the commit version starts with a !, that version is not built. Instead,
everything after the ! is used as a reason why it can't be built. The
purpose of this feature is to allow non-buildable releases (e.g. the source
is not published) to be flagged, so the scripts don't generate repeated
messages about them. (And also to record the information for review later).
If an apk has already been built, ! causes it to be deleted once
@code{fdroid update} is run; this is the procedure if ever a version has to
be replaced.
In addition to the three, always required, parameters described above, In addition to the three, always required, parameters described above,
further parameters can be added (in name=value format) to apply further further parameters can be added (in name=value format) to apply further
configuration to the build. These are (roughly in order of application): configuration to the build. These are (roughly in order of application):
@table @code @table @code
@item disable=<message>
Disables this build, giving a reason why. (For backwards compatibility, this
can also be achieved by starting the commit ID with '!')
The purpose of this feature is to allow non-buildable releases (e.g. the source
is not published) to be flagged, so the scripts don't generate repeated
messages about them. (And also to record the information for review later).
If an apk has already been built, disabling causes it to be deleted once
@code{fdroid update} is run; this is the procedure if ever a version has to
be replaced.
@item subdir=<path> @item subdir=<path>
Specifies to build from a subdirectory of the checked out source code. Specifies to build from a subdirectory of the checked out source code.
Normally this directory is changed to before building, Normally this directory is changed to before building,

View File

@ -681,7 +681,7 @@ def trybuild(app, thisbuild, build_dir, output_dir, also_check_dir, srclib_dir,
if os.path.exists(dest_also): if os.path.exists(dest_also):
return False return False
if thisbuild['commit'].startswith('!'): if thisbuild['commit'].startswith('!') or 'disable' in thisbuild:
return False return False
print "Building version " + thisbuild['version'] + ' of ' + app['id'] print "Building version " + thisbuild['version'] + ' of ' + app['id']

View File

@ -86,9 +86,9 @@ def main():
for thisbuild in app['builds']: for thisbuild in app['builds']:
if thisbuild['commit'].startswith('!'): if thisbuild['commit'].startswith('!') or 'disable' in thisbuild:
print ("..skipping version " + thisbuild['version'] + " - " + print ("..skipping version " + thisbuild['version'] + " - " +
thisbuild['commit'][1:]) thisbuild.get('disable', thisbuild['commit'][1:]))
else: else:
print "..scanning version " + thisbuild['version'] print "..scanning version " + thisbuild['version']

View File

@ -88,14 +88,14 @@ def update_wiki(apps, apks, verbose=False):
apklist.append(apk) apklist.append(apk)
# Include ones we can't build, as a special case... # Include ones we can't build, as a special case...
for thisbuild in app['builds']: for thisbuild in app['builds']:
if thisbuild['commit'].startswith('!'): if thisbuild['commit'].startswith('!') or 'disable' in thisbuild:
if thisbuild['vercode'] == app['Current Version Code']: if thisbuild['vercode'] == app['Current Version Code']:
cantupdate = True cantupdate = True
apklist.append({ apklist.append({
#TODO: Nasty: vercode is a string in the build, and an int elsewhere #TODO: Nasty: vercode is a string in the build, and an int elsewhere
'versioncode': int(thisbuild['vercode']), 'versioncode': int(thisbuild['vercode']),
'version': thisbuild['version'], 'version': thisbuild['version'],
'buildproblem': thisbuild['commit'][1:] 'buildproblem': thisbuild.get('disable', thisbuild['commit'][1:])
}) })
else: else:
builtit = False builtit = False
@ -232,7 +232,7 @@ def delete_disabled_builds(apps, apkcache, repodirs):
""" """
for app in apps: for app in apps:
for build in app['builds']: for build in app['builds']:
if build['commit'].startswith('!'): if build['commit'].startswith('!') or 'disable' in build:
apkfilename = app['id'] + '_' + str(build['vercode']) + '.apk' apkfilename = app['id'] + '_' + str(build['vercode']) + '.apk'
for repodir in repodirs: for repodir in repodirs:
apkpath = os.path.join(repodir, apkfilename) apkpath = os.path.join(repodir, apkfilename)