Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: sitescripts/extensions/bin/updateUpdateManifests.py

Issue 29354748: Fixes 4464 - Restore get_min_sdk_version() function from sitescripts.extensions.android module that… (Closed) Base URL: https://hg.adblockplus.org/sitescripts
Patch Set: Mock plugin repositories instead of cloning them Created Sept. 27, 2016, 9:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sitescripts/extensions/test/adblockplussafari.pem » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 def get_min_sdk_version(repo, version):
41 command = ['hg', 'cat', '-r', version, 'AndroidManifest.xml']
42 result = subprocess.check_output(command, cwd=repo.repository)
43 uses_sdk = dom.parseString(result).getElementsByTagName('uses-sdk')[0]
44 return uses_sdk.attributes['android:minSdkVersion'].value
38 45
39 46
40 def readMetadata(repo, version): 47 def readMetadata(repo, version):
41 """ 48 """
42 reads extension ID and compatibility information from metadata file in the 49 reads extension ID and compatibility information from metadata file in the
43 extension's repository 50 extension's repository
44 """ 51 """
45 if repo.type == 'android': 52 if repo.type == 'android':
46 command = ['hg', '-R', repo.repository, 'id', '-r', version, '-n'] 53 command = ['hg', '-R', repo.repository, 'id', '-r', version, '-n']
47 result = subprocess.check_output(command) 54 result = subprocess.check_output(command)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 """ 130 """
124 updates all update manifests with the current versions 131 updates all update manifests with the current versions
125 """ 132 """
126 133
127 parser = SafeConfigParser() 134 parser = SafeConfigParser()
128 getDownloadLinks(parser) 135 getDownloadLinks(parser)
129 writeUpdateManifest(parser) 136 writeUpdateManifest(parser)
130 137
131 if __name__ == '__main__': 138 if __name__ == '__main__':
132 updateUpdateManifests() 139 updateUpdateManifests()
OLDNEW
« no previous file with comments | « no previous file | sitescripts/extensions/test/adblockplussafari.pem » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld