Fix build on karmic: Work around Python/tar bug
[nacl-build.git] / mini_gclient.py
blob2698b380b63cd5503dd3a73f1528e96cd35b2224
2 # This is a *very* minimal version of gclient (which can be found at
3 # http://src.chromium.org/svn/trunk/tools/depot_tools/).
5 import subprocess
8 def read_file(filename):
9 fh = open(filename, "r")
10 try:
11 return fh.read()
12 finally:
13 fh.close()
16 def read_deps_file(filename):
17 scope = {}
18 def Var(varname):
19 return scope["vars"][varname]
20 scope["Var"] = Var
21 exec read_file(filename) in scope
22 return scope
25 def main():
26 scope = read_deps_file("native_client/DEPS")
27 for path, svn_url in sorted(scope["deps"].iteritems()):
28 if not svn_url.startswith("http://nativeclient.googlecode.com/svn/trunk"):
29 args = ["svn", "checkout", svn_url, path]
30 print args
31 subprocess.check_call(args)
34 if __name__ == "__main__":
35 main()