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

Unified Diff: sitescripts/extensions/bin/updateDownloadLinks.py

Issue 10942098: Make sure subprocess calls don`t ignore result codes indicating errors. Fix JS docs generation whil… (Closed)
Patch Set: Addressed issues Created July 5, 2013, 11:22 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/extensions/bin/updateDownloadLinks.py
===================================================================
--- a/sitescripts/extensions/bin/updateDownloadLinks.py
+++ b/sitescripts/extensions/bin/updateDownloadLinks.py
@@ -185,20 +185,21 @@ def readMetadata(repo, version):
manifest = dom.parseString(result)
usesSdk = manifest.getElementsByTagName('uses-sdk')[0]
return {
'revision': revision,
'minSdkVersion': usesSdk.attributes["android:minSdkVersion"].value,
}
else:
- try:
+ files = subprocess.check_output(['hg', '-R', repo.repository, 'locate', '-r', version]).splitlines()
+ if 'metadata.%s' % repo.type in files:
command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join(repo.repository, 'metadata.%s' % repo.type)]
result = subprocess.check_output(command)
- except:
+ else:
# Fall back to platform-independent metadata file for now
command = ['hg', '-R', repo.repository, 'cat', '-r', version, os.path.join(repo.repository, 'metadata')]
result = subprocess.check_output(command)
parser = SafeConfigParser()
parser.readfp(StringIO(result))
result = {

Powered by Google App Engine
This is Rietveld