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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 deps_map[needed_pkg]["provides"].add(bad_pkg) | 877 deps_map[needed_pkg]["provides"].add(bad_pkg) |
878 deps_map[bad_pkg]["needs"][needed_pkg] = "secret" | 878 deps_map[bad_pkg]["needs"][needed_pkg] = "secret" |
879 | 879 |
880 def MergeChildren(pkg, merge_type): | 880 def MergeChildren(pkg, merge_type): |
881 """Merge this package and all packages it provides.""" | 881 """Merge this package and all packages it provides.""" |
882 | 882 |
883 this_pkg = deps_map[pkg] | 883 this_pkg = deps_map[pkg] |
884 if (this_pkg[merge_type] or pkg not in final_pkgs): | 884 if (this_pkg[merge_type] or pkg not in final_pkgs): |
885 return | 885 return |
886 | 886 |
| 887 if pkg not in deps_info: |
| 888 emerge_cmd = "emerge" |
| 889 if self.board: |
| 890 emerge_cmd = "emerge-%s" % self.board |
| 891 emerge_cmd += " -pe =%s %s" % (pkg, " ".join(emerge.cmdline_packages)) |
| 892 use_str = os.environ.get("USE") |
| 893 if use_str: |
| 894 emerge_cmd = 'USE="%s" %s' % (use_str, emerge_cmd) |
| 895 print "ERROR: emerge has refused to update %s" % pkg |
| 896 print "Are there impossible-to-satisfy constraints in the dependency" |
| 897 print "graph? To debug the issue, try the following command:" |
| 898 print " %s" % emerge_cmd |
| 899 sys.exit(1) |
| 900 |
887 # Mark this package as non-optional | 901 # Mark this package as non-optional |
888 deps_info[pkg]["optional"] = False | 902 deps_info[pkg]["optional"] = False |
889 this_pkg[merge_type] = True | 903 this_pkg[merge_type] = True |
890 for w in this_pkg["provides"].difference(rebuild_blacklist): | 904 for w in this_pkg["provides"].difference(rebuild_blacklist): |
891 MergeChildren(w, merge_type) | 905 MergeChildren(w, merge_type) |
892 | 906 |
893 if this_pkg["action"] == "nomerge": | 907 if this_pkg["action"] == "nomerge": |
894 this_pkg["action"] = "merge" | 908 this_pkg["action"] = "merge" |
895 | 909 |
896 def RemotePackageDatabase(binhost_url): | 910 def RemotePackageDatabase(binhost_url): |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 # If we already upgraded portage, we don't need to do so again. But we do | 1706 # If we already upgraded portage, we don't need to do so again. But we do |
1693 # need to upgrade the rest of the packages. So we'll go ahead and do that. | 1707 # need to upgrade the rest of the packages. So we'll go ahead and do that. |
1694 if portage_upgrade: | 1708 if portage_upgrade: |
1695 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] | 1709 args = sys.argv[1:] + ["--nomerge=sys-apps/portage"] |
1696 os.execvp(os.path.realpath(sys.argv[0]), args) | 1710 os.execvp(os.path.realpath(sys.argv[0]), args) |
1697 | 1711 |
1698 print "Done" | 1712 print "Done" |
1699 | 1713 |
1700 if __name__ == "__main__": | 1714 if __name__ == "__main__": |
1701 main() | 1715 main() |
OLD | NEW |