X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=fdroidserver%2Fupdate.py;h=9f1ad43c0babf6b398ab6f036b9140c41dbcc178;hb=85632ba00efd92c3524394dbebff673335b94de5;hp=07c8db3024422f34522f108ae971a96fe16da715;hpb=329e0247d5b4fae6c0e1ac25ffd784ce851d54b1;p=fdroidserver.git diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 07c8db30..9f1ad43c 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -1,8 +1,10 @@ #!/usr/bin/env python3 # # update.py - part of the FDroid server tools -# Copyright (C) 2010-2015, Ciaran Gultnieks, ciaran@ciarang.com -# Copyright (C) 2013-2014 Daniel Martí +# Copyright (C) 2016, Blue Jay Wireless +# Copyright (C) 2014-2016, Hans-Christoph Steiner +# Copyright (C) 2010-2015, Ciaran Gultnieks +# Copyright (C) 2013-2014, Daniel Martí # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -951,6 +953,21 @@ def make_index(apps, sortedids, apks, repodir, archive, categories): repoel.setAttribute("pubkey", extract_pubkey().decode('utf-8')) root.appendChild(repoel) + for command in ('install', 'delete'): + packageNames = [] + key = command + '_list' + if key in config: + if isinstance(config[key], str): + packageNames = [config[key]] + elif all(isinstance(item, str) for item in config[key]): + packageNames = config[key] + else: + raise TypeError('only accepts strings, lists, and tuples') + for packageName in packageNames: + element = doc.createElement(command) + root.appendChild(element) + element.setAttribute('packageName', packageName) + for appid in sortedids: app = apps[appid]