Commit dba59533 authored by Jon Turney's avatar Jon Turney Committed by Hugo Beauzée-Luyssen

Add a simple script to update externals

Tweak the protobuf svn rev number requested slightly to r402, as r407
corresponds to a change in /wiki, which is not a path that svn-git considers by
default.

v2:
Update to handle fetching lss from git not svn
Rename script to fetch-externals
Update README.md

v3:
Drop protobuf rev number tweak now dep comes from git
Sort deps to order check out of src/testing/ before src/testing/gtest/

v4:
Use print as a function
parent b1bc0320
......@@ -8,6 +8,13 @@ google-breakpad with added support for Cygwin/MinGW:
### Preparation
Run the fetch-externals script to fetch submodules in the DEPS file (e.g the gyp and gtest dependencies).
(The upsteam repository is meant to be checked out using Chromium's `depot_tools`, which does this for you)
```
./fetch-externals
```
Run autoreconf to generate ./configure
````
......@@ -25,9 +32,6 @@ See README.orig.md
will produce `dump_syms.exe`, `minidump_dump.exe`, `minidump_stackwalk.exe`, `libbreakpad.a`,
and for MinGW `libcrash_generation_client.a`, `libcrash_generation_server.a`, `crash_generation_app.exe`
Note that since git-svn ignores svn externals, this repository is missing the
gyp and gtest dependencies.
## Using
See [Getting started with breakpad](https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/getting_started_with_breakpad.md)
......
#!/usr/bin/env python
#
# Read a depot_tools style DEPS file and recursively checkout the repos
# listed
#
from __future__ import print_function
import os
# required to make some DEPS files syntactically valid
def Var(var_name):
return '%s'
def system(cmd):
print(cmd)
os.system(cmd)
def checkout_deps(basepath):
depsfile = os.path.join(basepath, 'DEPS')
if not os.path.exists(depsfile):
print('Nothing to do for', depsfile)
return
print('Processing deps in', depsfile)
# evaluate contents of DEPS file
f = open(depsfile, 'r')
exec(f.read())
# process the path:url pairs in deps
for path in sorted(deps.keys()):
src = deps[path]
(url, rev) = src.split('@')
if path.startswith('src/'):
path = path[4:]
print('%s %s %s' % (url, path, rev))
if not os.path.exists(os.path.join(path, '.git')):
if url.find('svn') >= 0:
system('git svn clone -q %s %s -r %s' % (url, path, rev))
else:
system('git clone -n %s %s' % (url, path))
system('cd %s; git reset --hard %s' % (path, rev))
else:
if url.find('svn') >= 0:
system('cd %s; git svn fetch -q -r %s' % (path, rev))
system('cd %s; git reset --hard $(git svn find-rev r%s)' % (path, rev))
else:
system('cd %s; git fetch %s' % (path, url))
system('cd %s; git reset --hard %s' % (path, rev))
# and recurse
checkout_deps(os.path.join(basepath, path))
print('Done processing of', depsfile)
checkout_deps('.')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment