| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 set -e | 6 set -e |
| 7 | 7 |
| 8 http_port=8080 | 8 http_port=8080 |
| 9 ssh_port=29418 | 9 ssh_port=29418 |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 j = json.load(sys.stdin) | 81 j = json.load(sys.stdin) |
| 82 items = [(x, gerrit_re.match(x['name'])) for x in j['items']] | 82 items = [(x, gerrit_re.match(x['name'])) for x in j['items']] |
| 83 items = [(x, m.group(1), m.group(2)) for x, m in items if m] | 83 items = [(x, m.group(1), m.group(2)) for x, m in items if m] |
| 84 def _cmp(a, b): | 84 def _cmp(a, b): |
| 85 an = a[1].split('.') | 85 an = a[1].split('.') |
| 86 bn = b[1].split('.') | 86 bn = b[1].split('.') |
| 87 while len(an) < len(bn): | 87 while len(an) < len(bn): |
| 88 an.append('0') | 88 an.append('0') |
| 89 while len(bn) < len(an): | 89 while len(bn) < len(an): |
| 90 bn.append('0') | 90 bn.append('0') |
| 91 an.append(a[2][3:] if a[2] else '1000') | 91 # Disable using -rc versions. This is a temporary hack to avoid |
| 92 bn.append(b[2][3:] if b[2] else '1000') | 92 # picking up version 2.9-rc0, which requires java 7. These lines |
| 93 # should be un-commented after this bug is fixed: |
| 94 # https://code.google.com/p/chromium/issues/detail?id=346369 |
| 95 # an.append(a[2][3:] if a[2] else '1000') |
| 96 # bn.append(b[2][3:] if b[2] else '1000') |
| 93 for i in range(len(an)): | 97 for i in range(len(an)): |
| 94 if an[i] != bn[i]: | 98 if an[i] != bn[i]: |
| 95 return -1 if int(an[i]) > int(bn[i]) else 1 | 99 return -1 if int(an[i]) > int(bn[i]) else 1 |
| 96 return 0 | 100 return 0 |
| 97 | 101 |
| 98 if requested_version: | 102 if requested_version: |
| 99 for info, version in items: | 103 for info, version in items: |
| 100 if version == requested_version: | 104 if version == requested_version: |
| 101 print '"%s" "%s"' % (info['name'], info['md5Hash']) | 105 print '"%s" "%s"' % (info['name'], info['md5Hash']) |
| 102 sys.exit(0) | 106 sys.exit(0) |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 To use SSH API: | 203 To use SSH API: |
| 200 ssh ${username}@localhost -p ${ssh_port} -i ${rundir}/tmp/id_rsa gerrit | 204 ssh ${username}@localhost -p ${ssh_port} -i ${rundir}/tmp/id_rsa gerrit |
| 201 | 205 |
| 202 To enable 'git push' without a password prompt: | 206 To enable 'git push' without a password prompt: |
| 203 git config credential.helper 'store --file=${rundir}/tmp/.git-credentials' | 207 git config credential.helper 'store --file=${rundir}/tmp/.git-credentials' |
| 204 | 208 |
| 205 To stop the server: | 209 To stop the server: |
| 206 ${rundir}/bin/gerrit.sh stop | 210 ${rundir}/bin/gerrit.sh stop |
| 207 | 211 |
| 208 EOF | 212 EOF |
| OLD | NEW |