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

Side by Side Diff: ensure_dependencies.py

Issue 29716699: Issue 6453 - Update buildtools dep. to c830dfa08e2f, add custom ID and updateURL (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/file/b6190ccd9928
Patch Set: Created March 7, 2018, 10:11 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
« no previous file with comments | « dependencies ('k') | metadata.gecko » ('j') | 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 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 29 matching lines...) Expand all
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):
55 if not source.endswith('/'): 55 if not source.endswith('/'):
56 source += '/' 56 source += '/'
57 subprocess.check_call(['hg', 'clone', '--quiet', '--noupdate', source, t arget]) 57 subprocess.check_call(['hg', 'clone', '--quiet', '--noupdate', source, t arget])
58 58
59 def get_revision_id(self, repo, rev=None): 59 def get_revision_id(self, repo, rev=None):
60 command = ['hg', 'id', '--repository', repo, '--id'] 60 command = ['hg', 'id', '--repository', repo, '--id']
(...skipping 26 matching lines...) Expand all
87 with open(config_path, 'w') as stream: 87 with open(config_path, 'w') as stream:
88 config.write(stream) 88 config.write(stream)
89 89
90 module = os.path.relpath(target, repo) 90 module = os.path.relpath(target, repo)
91 _ensure_line_exists(ignore_path, module) 91 _ensure_line_exists(ignore_path, module)
92 92
93 def postprocess_url(self, url): 93 def postprocess_url(self, url):
94 return url 94 return url
95 95
96 96
97 class Git(): 97 class Git:
98 def istype(self, repodir): 98 def istype(self, repodir):
99 return os.path.exists(os.path.join(repodir, '.git')) 99 return os.path.exists(os.path.join(repodir, '.git'))
100 100
101 def clone(self, source, target): 101 def clone(self, source, target):
102 source = source.rstrip('/') 102 source = source.rstrip('/')
103 if not source.endswith('.git'): 103 if not source.endswith('.git'):
104 source += '.git' 104 source += '.git'
105 subprocess.check_call(['git', 'clone', '--quiet', source, target]) 105 subprocess.check_call(['git', 'clone', '--quiet', source, target])
106 106
107 def get_revision_id(self, repo, rev='HEAD'): 107 def get_revision_id(self, repo, rev='HEAD'):
(...skipping 330 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
« no previous file with comments | « dependencies ('k') | metadata.gecko » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld