chiark / gitweb /
Introduce disable= as a better way of disabling a build
authorCiaran Gultnieks <ciaran@ciarang.com>
Sat, 26 Oct 2013 09:26:47 +0000 (10:26 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Sat, 26 Oct 2013 09:28:12 +0000 (10:28 +0100)
Prefixing commit ID with ! and a message will still work, but that's
very silly. Using disable= is now the correct way.

docs/fdroid.texi
fdroidserver/build.py
fdroidserver/scanner.py
fdroidserver/update.py

index b96c8fdd701dafa17d19e62629bc903c5ab7519e..d917662bb9856a6220f54d25d61428705a416a4a 100644 (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
 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=<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>
 Specifies to build from a subdirectory of the checked out source code.
 Normally this directory is changed to before building,
index 18e17751dea3f5e428ac42d5ca14ebd9716ab87b..a2ca3cf824dc3decc8f694e0a859b498eef9f089 100644 (file)
@@ -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']
index 8f1132ea711f33de87b5c402f6d2de443ece1e30..2b62e2131b6b1be1e161f5d0149a05db03f65d8f 100644 (file)
@@ -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']
 
index 7a0b5d36efe96f3ed2df69db6b67a062b3f43ca1..ef31cae218de30a01e528f39aa1195c6de51d4d0 100644 (file)
@@ -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)