OLD | NEW |
1 #!/usr/bin/python2.6 | 1 #!/usr/bin/python2.6 |
2 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 2 # Copyright (c) 2010 The Chromium OS 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 """Program to run emerge in parallel, for significant speedup. | 6 """Program to run emerge in parallel, for significant speedup. |
7 | 7 |
8 Usage: | 8 Usage: |
9 ./parallel_emerge [--board=BOARD] [--workon=PKGS] [--no-workon-deps] | 9 ./parallel_emerge [--board=BOARD] [--workon=PKGS] [--no-workon-deps] |
10 [emerge args] package" | 10 [emerge args] package" |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 for dep in deps_map[pkg]["needs"]: | 1009 for dep in deps_map[pkg]["needs"]: |
1010 t = LastModifiedWithDeps(dep, pkg_db, cache) | 1010 t = LastModifiedWithDeps(dep, pkg_db, cache) |
1011 cache[pkg] = max(cache[pkg], t) | 1011 cache[pkg] = max(cache[pkg], t) |
1012 return cache[pkg] | 1012 return cache[pkg] |
1013 | 1013 |
1014 # For every package that's getting updated in our local cache (binary | 1014 # For every package that's getting updated in our local cache (binary |
1015 # or source), make sure we also update the children. If a package is | 1015 # or source), make sure we also update the children. If a package is |
1016 # built from source, all children must also be built from source. | 1016 # built from source, all children must also be built from source. |
1017 local_ready_cache, remote_ready_cache = {}, {} | 1017 local_ready_cache, remote_ready_cache = {}, {} |
1018 local_mtime_cache, remote_mtime_cache = {}, {} | 1018 local_mtime_cache, remote_mtime_cache = {}, {} |
1019 for pkg in final_pkgs: | 1019 for pkg in final_pkgs.difference(rebuild_blacklist): |
1020 # If all the necessary local packages are ready, and their | 1020 # If all the necessary local packages are ready, and their |
1021 # modification times are in sync, we don't need to do anything here. | 1021 # modification times are in sync, we don't need to do anything here. |
1022 local_mtime = LastModifiedWithDeps(pkg, local_pkgs, local_mtime_cache) | 1022 local_mtime = LastModifiedWithDeps(pkg, local_pkgs, local_mtime_cache) |
1023 local_ready = PrebuiltsReady(pkg, local_pkgs, local_ready_cache) | 1023 local_ready = PrebuiltsReady(pkg, local_pkgs, local_ready_cache) |
1024 if (not local_ready or local_pkgs.get(pkg, 0) < local_mtime and | 1024 if (not local_ready or local_pkgs.get(pkg, 0) < local_mtime and |
1025 pkg not in cycles and pkg not in rebuild_blacklist): | 1025 pkg not in cycles): |
1026 # OK, at least one package is missing from the local cache or is | 1026 # OK, at least one package is missing from the local cache or is |
1027 # outdated. This means we're going to have to install the package | 1027 # outdated. This means we're going to have to install the package |
1028 # and all dependencies. | 1028 # and all dependencies. |
1029 # | 1029 # |
1030 # If all the necessary remote packages are ready, and they're at | 1030 # If all the necessary remote packages are ready, and they're at |
1031 # least as new as our local packages, we can install them. | 1031 # least as new as our local packages, we can install them. |
1032 # Otherwise, we need to build from source. | 1032 # Otherwise, we need to build from source. |
1033 remote_mtime = LastModifiedWithDeps(pkg, remote_pkgs, | 1033 remote_mtime = LastModifiedWithDeps(pkg, remote_pkgs, |
1034 remote_mtime_cache) | 1034 remote_mtime_cache) |
1035 remote_ready = PrebuiltsReady(pkg, remote_pkgs, remote_ready_cache) | 1035 remote_ready = PrebuiltsReady(pkg, remote_pkgs, remote_ready_cache) |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 # If we already upgraded portage, we don't need to do so again. But we do | 1685 # If we already upgraded portage, we don't need to do so again. But we do |
1686 # need to upgrade the rest of the packages. So we'll go ahead and do that. | 1686 # need to upgrade the rest of the packages. So we'll go ahead and do that. |
1687 if portage_upgrade: | 1687 if portage_upgrade: |
1688 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] | 1688 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] |
1689 os.execvp(os.path.realpath(sys.argv[0]), args) | 1689 os.execvp(os.path.realpath(sys.argv[0]), args) |
1690 | 1690 |
1691 print "Done" | 1691 print "Done" |
1692 | 1692 |
1693 if __name__ == "__main__": | 1693 if __name__ == "__main__": |
1694 main() | 1694 main() |
OLD | NEW |