Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: ensure_dependencies.py

Issue 29796555: Issue 6621 (Closed)
Patch Set: Created June 1, 2018, 1:58 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # This Source Code Form is subject to the terms of the Mozilla Public 3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 6
7 import sys 7 import sys
8 import os 8 import os
9 import posixpath 9 import posixpath
10 import re 10 import re
(...skipping 23 matching lines...) Expand all
34 buildtools = buildtools hg:016d16f7137b git:f3f8692f82e5 34 buildtools = buildtools hg:016d16f7137b git:f3f8692f82e5
35 # Clone the adblockplus repository into adblockplus directory, overwriting the 35 # Clone the adblockplus repository into adblockplus directory, overwriting the
36 # usual source URL for Git repository and specifying VCS specific revision IDs . 36 # usual source URL for Git repository and specifying VCS specific revision IDs .
37 adblockplus = adblockplus hg:893426c6a6ab git:git@github.com:user/adblockplus. git@b2ffd52b 37 adblockplus = adblockplus hg:893426c6a6ab git:git@github.com:user/adblockplus. git@b2ffd52b
38 # Clone the adblockpluschrome repository into the adblockpluschrome directory, 38 # Clone the adblockpluschrome repository into the adblockpluschrome directory,
39 # from a specific Git repository, specifying the revision ID. 39 # from a specific Git repository, specifying the revision ID.
40 adblockpluschrome = git:git@github.com:user/adblockpluschrome.git@1fad3a7 40 adblockpluschrome = git:git@github.com:user/adblockpluschrome.git@1fad3a7
41 ''' 41 '''
42 42
43 SKIP_DEPENDENCY_UPDATES = os.environ.get( 43 SKIP_DEPENDENCY_UPDATES = os.environ.get(
44 'SKIP_DEPENDENCY_UPDATES', '' 44 'SKIP_DEPENDENCY_UPDATES', '',
45 ).lower() not in ('', '0', 'false') 45 ).lower() not in ('', '0', 'false')
46 46
47 NPM_LOCKFILE = '.npm_install_lock' 47 NPM_LOCKFILE = '.npm_install_lock'
48 48
49 49
50 class Mercurial: 50 class Mercurial:
51 def istype(self, repodir): 51 def istype(self, repodir):
52 return os.path.exists(os.path.join(repodir, '.hg')) 52 return os.path.exists(os.path.join(repodir, '.hg'))
53 53
54 def clone(self, source, target): 54 def clone(self, source, target):
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 141
142 repo_types = OrderedDict(( 142 repo_types = OrderedDict((
143 ('hg', Mercurial()), 143 ('hg', Mercurial()),
144 ('git', Git()), 144 ('git', Git()),
145 )) 145 ))
146 146
147 # [vcs:]value 147 # [vcs:]value
148 item_regexp = re.compile( 148 item_regexp = re.compile(
149 '^(?:(' + '|'.join(map(re.escape, repo_types.keys())) + '):)?' 149 '^(?:(' + '|'.join(map(re.escape, repo_types.keys())) + '):)?'
150 '(.+)$' 150 '(.+)$',
151 ) 151 )
152 152
153 # [url@]rev 153 # [url@]rev
154 source_regexp = re.compile( 154 source_regexp = re.compile(
155 '^(?:(.*)@)?' 155 '^(?:(.*)@)?'
156 '(.+)$' 156 '(.+)$',
157 ) 157 )
158 158
159 159
160 def merge_seqs(seq1, seq2): 160 def merge_seqs(seq1, seq2):
161 """Return a list of any truthy values from the suplied sequences 161 """Return a list of any truthy values from the suplied sequences
162 162
163 (None, 2), (1,) => [1, 2] 163 (None, 2), (1,) => [1, 2]
164 None, (1, 2) => [1, 2] 164 None, (1, 2) => [1, 2]
165 (1, 2), (3, 4) => [3, 4] 165 (1, 2), (3, 4) => [3, 4]
166 """ 166 """
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 args = parser.parse_args() 438 args = parser.parse_args()
439 439
440 if args.quiet: 440 if args.quiet:
441 logging.disable(logging.INFO) 441 logging.disable(logging.INFO)
442 442
443 repos = args.repos 443 repos = args.repos
444 if not len(repos): 444 if not len(repos):
445 repos = [os.path.dirname(__file__)] 445 repos = [os.path.dirname(__file__)]
446 for repo in repos: 446 for repo in repos:
447 resolve_deps(repo) 447 resolve_deps(repo)
OLDNEW

Powered by Google App Engine
This is Rietveld