Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: go/roll_goop.py

Issue 1375553003: go: Roll Goopfile, remove two no longer used packages. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « go/clean_goop.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 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 """Updates all SHA1s in Goopfile to point to current refs/heads/master. 6 """Updates all SHA1s in Goopfile to point to current refs/heads/master.
7 7
8 Horribly slow, but simple. 8 Horribly slow, but simple.
9 9
10 Supposed to be followed by './env.py goop update' and manual examination of 10 Supposed to be followed by './env.py goop update' and manual examination of
11 all new wonderful packages we now depend on (to setup mirrors for them, etc). 11 all new wonderful packages we now depend on (to setup mirrors for them, etc).
12 See README.md. 12 See README.md.
13 """ 13 """
14 14
15 import os 15 import os
16 import re 16 import re
17 import subprocess 17 import subprocess
18 import sys 18 import sys
19 import urllib2 19 import urllib2
20 20
21 21
22 GO_DIR = os.path.dirname(os.path.abspath(__file__)) 22 GO_DIR = os.path.dirname(os.path.abspath(__file__))
23 23
24 24
25 # Packages that should be checked out via some non-standard ref. Notable 25 # Packages that should be checked out via some non-standard ref. Notable
26 # examples are packages distributed via gopkg.in hackery. 26 # examples are packages distributed via gopkg.in hackery.
27 EXCEPTIONS = { 27 EXCEPTIONS = {
28 'github.com/luci/gkvlite': 'refs/heads/32bitKeys',
29 'gopkg.in/fsnotify.v0': 'refs/heads/v0', 28 'gopkg.in/fsnotify.v0': 'refs/heads/v0',
30 'gopkg.in/tomb.v1': 'refs/heads/v1', 29 'gopkg.in/tomb.v1': 'refs/heads/v1',
31 'gopkg.in/yaml.v2': 'refs/heads/v2', 30 'gopkg.in/yaml.v2': 'refs/heads/v2',
32 } 31 }
33 32
34 33
35 def parse_goop_line(line): 34 def parse_goop_line(line):
36 """Line of Goop file -> (package name, ref, mirror repo or None).""" 35 """Line of Goop file -> (package name, ref, mirror repo or None)."""
37 chunks = [c.strip() for c in line.split()] 36 chunks = [c.strip() for c in line.split()]
38 mirror = None 37 mirror = None
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 new_goop = '\n'.join(filtered) + '\n' 102 new_goop = '\n'.join(filtered) + '\n'
104 if new_goop.strip() == goop.strip(): 103 if new_goop.strip() == goop.strip():
105 print 'No changes.' 104 print 'No changes.'
106 return 0 105 return 0
107 with open(os.path.join(GO_DIR, 'Goopfile'), 'wt') as f: 106 with open(os.path.join(GO_DIR, 'Goopfile'), 'wt') as f:
108 f.write(new_goop) 107 f.write(new_goop)
109 return 0 108 return 0
110 109
111 110
112 if __name__ == '__main__': 111 if __name__ == '__main__':
113 main() 112 sys.exit(main())
OLDNEW
« no previous file with comments | « go/clean_goop.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698