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 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 Returns: | 806 Returns: |
807 A dict mapping package identifiers to modification times. | 807 A dict mapping package identifiers to modification times. |
808 """ | 808 """ |
809 | 809 |
810 if not binhost_url: | 810 if not binhost_url: |
811 return {} | 811 return {} |
812 | 812 |
813 url = binhost_url + "/Packages" | 813 url = binhost_url + "/Packages" |
814 | 814 |
815 prebuilt_pkgs = {} | 815 prebuilt_pkgs = {} |
816 f = urllib2.urlopen(url) | 816 try: |
| 817 f = urllib2.urlopen(url) |
| 818 except urllib2.HTTPError as e: |
| 819 if e.code == 404: |
| 820 return {} |
| 821 else: |
| 822 raise |
817 for line in f: | 823 for line in f: |
818 if line.startswith("CPV: "): | 824 if line.startswith("CPV: "): |
819 pkg = line.replace("CPV: ", "").rstrip() | 825 pkg = line.replace("CPV: ", "").rstrip() |
820 elif line.startswith("MTIME: "): | 826 elif line.startswith("MTIME: "): |
821 prebuilt_pkgs[pkg] = int(line[:-1].replace("MTIME: ", "")) | 827 prebuilt_pkgs[pkg] = int(line[:-1].replace("MTIME: ", "")) |
822 f.close() | 828 f.close() |
823 | 829 |
824 return prebuilt_pkgs | 830 return prebuilt_pkgs |
825 | 831 |
826 def LocalPackageDatabase(): | 832 def LocalPackageDatabase(): |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 world_set.update(new_world_pkgs) | 1329 world_set.update(new_world_pkgs) |
1324 | 1330 |
1325 # Update environment (library cache, symlinks, etc.) | 1331 # Update environment (library cache, symlinks, etc.) |
1326 if deps.board and "--pretend" not in emerge.opts: | 1332 if deps.board and "--pretend" not in emerge.opts: |
1327 portage.env_update() | 1333 portage.env_update() |
1328 | 1334 |
1329 print "Done" | 1335 print "Done" |
1330 | 1336 |
1331 if __name__ == "__main__": | 1337 if __name__ == "__main__": |
1332 main() | 1338 main() |
OLD | NEW |