From: Ciaran Gultnieks Date: Sat, 26 Oct 2013 09:26:47 +0000 (+0100) Subject: Introduce disable= as a better way of disabling a build X-Git-Tag: 0.1~300 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=715035a707ab81ef9729b6c7f70e9d5c3a6ef8d3;p=fdroidserver.git 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. --- diff --git a/docs/fdroid.texi b/docs/fdroid.texi index b96c8fdd..d917662b 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -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 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, further parameters can be added (in name=value format) to apply further configuration to the build. These are (roughly in order of application): @table @code +@item disable= +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= Specifies to build from a subdirectory of the checked out source code. Normally this directory is changed to before building, diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 18e17751..a2ca3cf8 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -681,7 +681,7 @@ def trybuild(app, thisbuild, build_dir, output_dir, also_check_dir, srclib_dir, if os.path.exists(dest_also): return False - if thisbuild['commit'].startswith('!'): + if thisbuild['commit'].startswith('!') or 'disable' in thisbuild: return False print "Building version " + thisbuild['version'] + ' of ' + app['id'] diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index 8f1132ea..2b62e213 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -86,9 +86,9 @@ def main(): for thisbuild in app['builds']: - if thisbuild['commit'].startswith('!'): + if thisbuild['commit'].startswith('!') or 'disable' in thisbuild: print ("..skipping version " + thisbuild['version'] + " - " + - thisbuild['commit'][1:]) + thisbuild.get('disable', thisbuild['commit'][1:])) else: print "..scanning version " + thisbuild['version'] diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 7a0b5d36..ef31cae2 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -88,14 +88,14 @@ def update_wiki(apps, apks, verbose=False): apklist.append(apk) # Include ones we can't build, as a special case... for thisbuild in app['builds']: - if thisbuild['commit'].startswith('!'): + if thisbuild['commit'].startswith('!') or 'disable' in thisbuild: if thisbuild['vercode'] == app['Current Version Code']: cantupdate = True apklist.append({ #TODO: Nasty: vercode is a string in the build, and an int elsewhere 'versioncode': int(thisbuild['vercode']), 'version': thisbuild['version'], - 'buildproblem': thisbuild['commit'][1:] + 'buildproblem': thisbuild.get('disable', thisbuild['commit'][1:]) }) else: builtit = False @@ -232,7 +232,7 @@ def delete_disabled_builds(apps, apkcache, repodirs): """ for app in apps: for build in app['builds']: - if build['commit'].startswith('!'): + if build['commit'].startswith('!') or 'disable' in build: apkfilename = app['id'] + '_' + str(build['vercode']) + '.apk' for repodir in repodirs: apkpath = os.path.join(repodir, apkfilename)