OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |