| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Native Client Authors. All rights reserved. | 2 # Copyright 2015 The Native Client 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 """Find which packages are effected by a given change. | 5 """Find which packages are effected by a given change. |
| 6 | 6 |
| 7 Accepts a list of changed files and outputs a list of effected | 7 Accepts a list of changed files and outputs a list of effected |
| 8 packages. Outputs 'all' if any shared/non-package-specific | 8 packages. Outputs 'all' if any shared/non-package-specific |
| 9 file if changed.""" | 9 file if changed.""" |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 package_filter) | 38 package_filter) |
| 39 print '\n'.join(effected_packages) | 39 print '\n'.join(effected_packages) |
| 40 return 0 | 40 return 0 |
| 41 | 41 |
| 42 # Normally when changins files outside of the 'ports' directory will | 42 # Normally when changins files outside of the 'ports' directory will |
| 43 # trigger the rebuilding of all packages. However certainly files are | 43 # trigger the rebuilding of all packages. However certainly files are |
| 44 # known to not effect the building on packages and those are listed here. | 44 # known to not effect the building on packages and those are listed here. |
| 45 IGNORE_FILES = [ | 45 IGNORE_FILES = [ |
| 46 'build_tools/find_effected_packages.py', | 46 'build_tools/find_effected_packages.py', |
| 47 'build_tools/partition*.txt', | 47 'build_tools/partition*.txt', |
| 48 'AUTHORS', |
| 48 '*/test_*.py', | 49 '*/test_*.py', |
| 49 ] | 50 ] |
| 50 | 51 |
| 51 def find_effected_packages(files, include_deps, package_filter): | 52 def find_effected_packages(files, include_deps, package_filter): |
| 52 packages = [] | 53 packages = [] |
| 53 to_resolve = [] | 54 to_resolve = [] |
| 54 | 55 |
| 55 def AddPackage(package): | 56 def AddPackage(package): |
| 56 if package_filter and package.NAME not in package_filter: | 57 if package_filter and package.NAME not in package_filter: |
| 57 naclports.LogVerbose('Filtered out package: %s' % package.NAME) | 58 naclports.LogVerbose('Filtered out package: %s' % package.NAME) |
| (...skipping 27 matching lines...) Expand all Loading... |
| 85 packages = [p for p in packages if p in package_filter] | 86 packages = [p for p in packages if p in package_filter] |
| 86 return packages | 87 return packages |
| 87 | 88 |
| 88 | 89 |
| 89 if __name__ == '__main__': | 90 if __name__ == '__main__': |
| 90 try: | 91 try: |
| 91 sys.exit(main(sys.argv[1:])) | 92 sys.exit(main(sys.argv[1:])) |
| 92 except naclports.Error as e: | 93 except naclports.Error as e: |
| 93 sys.stderr.write('%s\n' % e) | 94 sys.stderr.write('%s\n' % e) |
| 94 sys.exit(-1) | 95 sys.exit(-1) |
| OLD | NEW |