Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: gclient.py

Issue 701893002: Don't enforce allowed_hosts for custom_deps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Meta checkout manager supporting both Subversion and GIT.""" 6 """Meta checkout manager supporting both Subversion and GIT."""
7 # Files 7 # Files
8 # .gclient : Current client configuration, written by 'config' command. 8 # .gclient : Current client configuration, written by 'config' command.
9 # Format is a Python script defining 'solutions', a list whose 9 # Format is a Python script defining 'solutions', a list whose
10 # entries each are maps binding the strings "name" and "url" 10 # entries each are maps binding the strings "name" and "url"
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 775
776 def findDepsFromNotAllowedHosts(self): 776 def findDepsFromNotAllowedHosts(self):
777 """Returns a list of depenecies from not allowed hosts. 777 """Returns a list of depenecies from not allowed hosts.
778 778
779 If allowed_hosts is not set, allows all hosts and returns empty list. 779 If allowed_hosts is not set, allows all hosts and returns empty list.
780 """ 780 """
781 if not self._allowed_hosts: 781 if not self._allowed_hosts:
782 return [] 782 return []
783 bad_deps = [] 783 bad_deps = []
784 for dep in self._dependencies: 784 for dep in self._dependencies:
785 # Don't enforce this for custom_deps.
786 if dep.name in self._custom_deps:
787 continue
785 if isinstance(dep.url, basestring): 788 if isinstance(dep.url, basestring):
786 parsed_url = urlparse.urlparse(dep.url) 789 parsed_url = urlparse.urlparse(dep.url)
787 if parsed_url.netloc and parsed_url.netloc not in self._allowed_hosts: 790 if parsed_url.netloc and parsed_url.netloc not in self._allowed_hosts:
788 bad_deps.append(dep) 791 bad_deps.append(dep)
789 return bad_deps 792 return bad_deps
790 793
791 # Arguments number differs from overridden method 794 # Arguments number differs from overridden method
792 # pylint: disable=W0221 795 # pylint: disable=W0221
793 def run(self, revision_overrides, command, args, work_queue, options): 796 def run(self, revision_overrides, command, args, work_queue, options):
794 """Runs |command| then parse the DEPS file.""" 797 """Runs |command| then parse the DEPS file."""
(...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 print >> sys.stderr, 'Error: %s' % str(e) 2257 print >> sys.stderr, 'Error: %s' % str(e)
2255 return 1 2258 return 1
2256 finally: 2259 finally:
2257 gclient_utils.PrintWarnings() 2260 gclient_utils.PrintWarnings()
2258 2261
2259 2262
2260 if '__main__' == __name__: 2263 if '__main__' == __name__:
2261 sys.exit(Main(sys.argv[1:])) 2264 sys.exit(Main(sys.argv[1:]))
2262 2265
2263 # vim: ts=2:sw=2:tw=80:et: 2266 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698