| 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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 # Are we upgrading portage? If so, and there are more packages to merge, | 1646 # Are we upgrading portage? If so, and there are more packages to merge, |
| 1647 # schedule a restart of parallel_emerge to merge the rest. This ensures that | 1647 # schedule a restart of parallel_emerge to merge the rest. This ensures that |
| 1648 # we pick up all updates to portage settings before merging any more | 1648 # we pick up all updates to portage settings before merging any more |
| 1649 # packages. | 1649 # packages. |
| 1650 portage_upgrade = False | 1650 portage_upgrade = False |
| 1651 root = emerge.settings["ROOT"] | 1651 root = emerge.settings["ROOT"] |
| 1652 final_db = emerge.depgraph._dynamic_config.mydbapi[root] | 1652 final_db = emerge.depgraph._dynamic_config.mydbapi[root] |
| 1653 if root == "/": | 1653 if root == "/": |
| 1654 for db_pkg in final_db.match_pkgs("sys-apps/portage"): | 1654 for db_pkg in final_db.match_pkgs("sys-apps/portage"): |
| 1655 portage_pkg = deps_graph.get(db_pkg.cpv) | 1655 portage_pkg = deps_graph.get(db_pkg.cpv) |
| 1656 if portage and len(deps_graph) > 1: | 1656 if portage_pkg and len(deps_graph) > 1: |
| 1657 portage_pkg["needs"].clear() |
| 1658 portage_pkg["provides"].clear() |
| 1657 deps_graph = { str(db_pkg.cpv): portage_pkg } | 1659 deps_graph = { str(db_pkg.cpv): portage_pkg } |
| 1658 portage_upgrade = True | 1660 portage_upgrade = True |
| 1659 if "--quiet" not in emerge.opts: | 1661 if "--quiet" not in emerge.opts: |
| 1660 print "Upgrading portage first, then restarting..." | 1662 print "Upgrading portage first, then restarting..." |
| 1661 | 1663 |
| 1662 # Run the queued emerges. | 1664 # Run the queued emerges. |
| 1663 scheduler = EmergeQueue(deps_graph, emerge, deps.package_db, deps.show_output) | 1665 scheduler = EmergeQueue(deps_graph, emerge, deps.package_db, deps.show_output) |
| 1664 scheduler.Run() | 1666 scheduler.Run() |
| 1665 | 1667 |
| 1666 # Update world. | 1668 # Update world. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1682 # If we already upgraded portage, we don't need to do so again. But we do | 1684 # If we already upgraded portage, we don't need to do so again. But we do |
| 1683 # need to upgrade the rest of the packages. So we'll go ahead and do that. | 1685 # need to upgrade the rest of the packages. So we'll go ahead and do that. |
| 1684 if portage_upgrade: | 1686 if portage_upgrade: |
| 1685 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] | 1687 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] |
| 1686 os.execvp(os.path.realpath(sys.argv[0]), args) | 1688 os.execvp(os.path.realpath(sys.argv[0]), args) |
| 1687 | 1689 |
| 1688 print "Done" | 1690 print "Done" |
| 1689 | 1691 |
| 1690 if __name__ == "__main__": | 1692 if __name__ == "__main__": |
| 1691 main() | 1693 main() |
| OLD | NEW |