Left: | ||
Right: |
OLD | NEW |
---|---|
1 # This file is part of the Adblock Plus web scripts, | 1 # This file is part of the Adblock Plus web scripts, |
2 # Copyright (C) 2006-2016 Eyeo GmbH | 2 # Copyright (C) 2006-2016 Eyeo GmbH |
3 # | 3 # |
4 # Adblock Plus is free software: you can redistribute it and/or modify | 4 # Adblock Plus is free software: you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License version 3 as | 5 # it under the terms of the GNU General Public License version 3 as |
6 # published by the Free Software Foundation. | 6 # published by the Free Software Foundation. |
7 # | 7 # |
8 # Adblock Plus is distributed in the hope that it will be useful, | 8 # Adblock Plus is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 14 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 """ | 16 """ |
17 Generate update manifests | 17 Generate update manifests |
18 ========================= | 18 ========================= |
19 | 19 |
20 This script generates update manifests for all extensions and apps | 20 This script generates update manifests for all extensions and apps |
21 """ | 21 """ |
22 | 22 |
23 import os | 23 import os |
24 import re | 24 import re |
25 import sys | 25 import sys |
26 import subprocess | 26 import subprocess |
27 import xml.dom.minidom as dom | |
27 from ConfigParser import SafeConfigParser | 28 from ConfigParser import SafeConfigParser |
28 | 29 |
29 from buildtools.packagerGecko import KNOWN_APPS | 30 from buildtools.packagerGecko import KNOWN_APPS |
30 from buildtools.packagerSafari import get_developer_identifier | 31 from buildtools.packagerSafari import get_developer_identifier |
31 from buildtools.xarfile import read_certificates_and_key | 32 from buildtools.xarfile import read_certificates_and_key |
32 | 33 |
33 from sitescripts.utils import get_config, get_template | 34 from sitescripts.utils import get_config, get_template |
34 from sitescripts.extensions.utils import ( | 35 from sitescripts.extensions.utils import ( |
35 Configuration, getDownloadLinks, | 36 Configuration, getDownloadLinks, |
36 writeIEUpdateManifest, writeAndroidUpdateManifest) | 37 writeIEUpdateManifest, writeAndroidUpdateManifest) |
37 from sitescripts.extensions.android import get_min_sdk_version | 38 |
39 | |
40 ANDROID_VERSIONS = ['1.0', '1.1', '1.5', '1.6', '2.0', '2.0.1', '2.1', | |
Sebastian Noack
2016/09/22 16:14:52
Is this variable even used?
Vasily Kuznetsov
2016/09/23 16:33:35
Don't think so. It just seemed important so I copi
Sebastian Noack
2016/09/23 17:29:25
It was only used by get_min_android_version(), the
| |
41 '2.2', '2.3', '2.3.3', '3.0', '3.1', '3.2', '4.0', | |
42 '4.0.3', '4.1', '4.2', '4.3', '4.4'] | |
43 | |
44 | |
45 def get_min_sdk_version(repo, version): | |
46 command = ['hg', 'cat', '-r', version, 'AndroidManifest.xml'] | |
47 result = subprocess.check_output(command, cwd=repo.repository) | |
48 uses_sdk = dom.parseString(result).getElementsByTagName('uses-sdk')[0] | |
49 return uses_sdk.attributes['android:minSdkVersion'].value | |
38 | 50 |
39 | 51 |
40 def readMetadata(repo, version): | 52 def readMetadata(repo, version): |
41 """ | 53 """ |
42 reads extension ID and compatibility information from metadata file in the | 54 reads extension ID and compatibility information from metadata file in the |
43 extension's repository | 55 extension's repository |
44 """ | 56 """ |
45 if repo.type == 'android': | 57 if repo.type == 'android': |
46 command = ['hg', '-R', repo.repository, 'id', '-r', version, '-n'] | 58 command = ['hg', '-R', repo.repository, 'id', '-r', version, '-n'] |
47 result = subprocess.check_output(command) | 59 result = subprocess.check_output(command) |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
123 """ | 135 """ |
124 updates all update manifests with the current versions | 136 updates all update manifests with the current versions |
125 """ | 137 """ |
126 | 138 |
127 parser = SafeConfigParser() | 139 parser = SafeConfigParser() |
128 getDownloadLinks(parser) | 140 getDownloadLinks(parser) |
129 writeUpdateManifest(parser) | 141 writeUpdateManifest(parser) |
130 | 142 |
131 if __name__ == '__main__': | 143 if __name__ == '__main__': |
132 updateUpdateManifests() | 144 updateUpdateManifests() |
OLD | NEW |