Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
check_deps Namespace Reference

Functions

 main ()
 

Variables

 INFRA_BOTS_DIR = os.path.dirname(os.path.realpath(__file__))
 
 SKIA_DIR = os.path.abspath(os.path.join(INFRA_BOTS_DIR, os.pardir, os.pardir))
 

Detailed Description

Check the DEPS file for correctness.

Function Documentation

◆ main()

check_deps.main ( )
Load the DEPS file and verify that all entries are valid.

Definition at line 25 of file check_deps.py.

25def main():
26 """Load the DEPS file and verify that all entries are valid."""
27 # Find gclient.py and run that instead of simply "gclient", which calls into
28 # update_depot_tools.
29 gclient = subprocess.check_output([
30 utils.WHICH, utils.GCLIENT]).decode('utf-8')
31 gclient_py = os.path.join(os.path.dirname(gclient), 'gclient.py')
32 python = sys.executable or 'python'
33
34 # Obtain the DEPS mapping.
35 output = subprocess.check_output(
36 [python, gclient_py, 'revinfo'], cwd=SKIA_DIR).decode('utf-8')
37
38 # Check each entry.
39 errs = []
40 for e in output.rstrip().splitlines():
41 split = e.split(': ')
42 if len(split) != 2:
43 errs.append(
44 'Failed to parse `gclient revinfo` output; invalid format: %s' % e)
45 continue
46 if split[0] == 'skia':
47 continue
48 split = split[1].split('@')
49 if len(split) != 2:
50 errs.append(
51 'Failed to parse `gclient revinfo` output; invalid format: %s' % e)
52 continue
53 repo = split[0]
54 rev = split[1]
55 if 'chrome-infra-packages' in repo:
56 continue
57 if not 'googlesource.com' in repo:
58 errs.append(
59 'DEPS must be hosted on googlesource.com; %s is not allowed. '
60 'See http://go/new-skia-git-mirror' % repo)
61 if not re.match(r'^[a-z0-9]{40}$', rev):
62 errs.append('%s: "%s" does not look like a commit hash.' % (repo, rev))
63 if errs:
64 print('Found problems in DEPS:', file=sys.stderr)
65 for err in errs:
66 print(err, file=sys.stderr)
67 sys.exit(1)
68
69
void print(void *str)
Definition bridge.cpp:126
Definition main.py:1
static DecodeResult decode(std::string path)

Variable Documentation

◆ INFRA_BOTS_DIR

check_deps.INFRA_BOTS_DIR = os.path.dirname(os.path.realpath(__file__))

Definition at line 21 of file check_deps.py.

◆ SKIA_DIR

check_deps.SKIA_DIR = os.path.abspath(os.path.join(INFRA_BOTS_DIR, os.pardir, os.pardir))

Definition at line 22 of file check_deps.py.