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

Side by Side Diff: ensure_dependencies.py

Issue 29501558: Issue 5383 - Add tests for the Chrome and Firefox packagers (Closed)
Patch Set: Rebasing against current master (502:7e896c368056) Created Oct. 17, 2017, 12:39 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 | « README.md ('k') | package.json » ('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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 if level == 0: 348 if level == 0:
349 logging.warning('No dependencies file in directory %s, nothing to do ...\n%s' % (repodir, USAGE)) 349 logging.warning('No dependencies file in directory %s, nothing to do ...\n%s' % (repodir, USAGE))
350 return 350 return
351 if level >= 10: 351 if level >= 10:
352 logging.warning('Too much subrepository nesting, ignoring %s' % repo) 352 logging.warning('Too much subrepository nesting, ignoring %s' % repo)
353 return 353 return
354 354
355 if overrideroots is not None: 355 if overrideroots is not None:
356 config['_root'] = overrideroots 356 config['_root'] = overrideroots
357 357
358 # F823
359 vcs = None
360
358 for dir, sources in sorted(config.iteritems()): 361 for dir, sources in sorted(config.iteritems()):
359 if (dir.startswith('_') or 362 if (dir.startswith('_') or
360 skipdependencies.intersection([s[0] for s in sources if s[0]])): 363 skipdependencies.intersection([s[0] for s in sources if s[0]])):
361 continue 364 continue
362 365
363 target = safe_join(repodir, dir) 366 target = safe_join(repodir, dir)
364 parenttype = get_repo_type(repodir) 367 parenttype = get_repo_type(repodir)
365 _root = config.get('_root', {}) 368 _root = config.get('_root', {})
366 369
367 for key in sources.keys() + _root.keys(): 370 for key in sources.keys() + _root.keys():
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 for l in file_content: 422 for l in file_content:
420 print >>f, l 423 print >>f, l
421 424
422 425
423 if __name__ == '__main__': 426 if __name__ == '__main__':
424 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO) 427 logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.INFO)
425 428
426 parser = argparse.ArgumentParser(description='Verify dependencies for a set of repositories, by default the repository of this script.') 429 parser = argparse.ArgumentParser(description='Verify dependencies for a set of repositories, by default the repository of this script.')
427 parser.add_argument('repos', metavar='repository', type=str, nargs='*', help ='Repository path') 430 parser.add_argument('repos', metavar='repository', type=str, nargs='*', help ='Repository path')
428 parser.add_argument('-q', '--quiet', action='store_true', help='Suppress inf ormational output') 431 parser.add_argument('-q', '--quiet', action='store_true', help='Suppress inf ormational output')
432 parser.add_argument(
433 '--nodejs-only',
434 action='store_true',
435 help='Install Node.js production-only dependencies only'
436 )
429 args = parser.parse_args() 437 args = parser.parse_args()
430 438
431 if args.quiet: 439 if args.quiet:
432 logging.disable(logging.INFO) 440 logging.disable(logging.INFO)
433 441
434 repos = args.repos 442 if args.nodejs_only:
435 if not len(repos): 443 vcs = get_repo_type('.')
436 repos = [os.path.dirname(__file__)] 444 resolve_npm_dependencies('.', vcs)
437 for repo in repos: 445 else:
438 resolve_deps(repo) 446 repos = args.repos
447 if not len(repos):
448 repos = [os.path.dirname(__file__)]
449 for repo in repos:
450 resolve_deps(repo)
OLDNEW
« no previous file with comments | « README.md ('k') | package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld