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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 # variables are normally setup inside emerge-${BOARD}, but since we don't | 270 # variables are normally setup inside emerge-${BOARD}, but since we don't |
271 # call that script, we have to set it up here. These variables serve to | 271 # call that script, we have to set it up here. These variables serve to |
272 # point our tools at /build/BOARD and to setup cross compiles to the | 272 # point our tools at /build/BOARD and to setup cross compiles to the |
273 # appropriate board as configured in toolchain.conf. | 273 # appropriate board as configured in toolchain.conf. |
274 if self.board: | 274 if self.board: |
275 os.environ["PORTAGE_CONFIGROOT"] = "/build/" + self.board | 275 os.environ["PORTAGE_CONFIGROOT"] = "/build/" + self.board |
276 os.environ["PORTAGE_SYSROOT"] = "/build/" + self.board | 276 os.environ["PORTAGE_SYSROOT"] = "/build/" + self.board |
277 os.environ["SYSROOT"] = "/build/" + self.board | 277 os.environ["SYSROOT"] = "/build/" + self.board |
278 scripts_dir = os.path.dirname(os.path.realpath(__file__)) | 278 scripts_dir = os.path.dirname(os.path.realpath(__file__)) |
279 toolchain_path = "%s/../overlays/overlay-%s/toolchain.conf" | 279 toolchain_path = "%s/../overlays/overlay-%s/toolchain.conf" |
280 f = open(toolchain_path % (scripts_dir, self.board)) | 280 # Strip the variant out of the board name to look for the toolchain. This |
| 281 # is similar to what setup_board does. |
| 282 board_no_variant = self.board.split('_')[0] |
| 283 f = open(toolchain_path % (scripts_dir, board_no_variant)) |
281 os.environ["CHOST"] = f.readline().strip() | 284 os.environ["CHOST"] = f.readline().strip() |
282 f.close() | 285 f.close() |
283 | 286 |
284 # Although CHROMEOS_ROOT isn't specific to boards, it's normally setup | 287 # Although CHROMEOS_ROOT isn't specific to boards, it's normally setup |
285 # inside emerge-${BOARD}, so we set it up here for compatibility. It | 288 # inside emerge-${BOARD}, so we set it up here for compatibility. It |
286 # will be going away soon as we migrate to CROS_WORKON_SRCROOT. | 289 # will be going away soon as we migrate to CROS_WORKON_SRCROOT. |
287 os.environ.setdefault("CHROMEOS_ROOT", os.environ["HOME"] + "/trunk") | 290 os.environ.setdefault("CHROMEOS_ROOT", os.environ["HOME"] + "/trunk") |
288 | 291 |
289 # Modify the environment to disable locking. | 292 # Modify the environment to disable locking. |
290 os.environ["PORTAGE_LOCKS"] = "false" | 293 os.environ["PORTAGE_LOCKS"] = "false" |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 for db_pkg in final_db.match_pkgs(pkg): | 1260 for db_pkg in final_db.match_pkgs(pkg): |
1258 print "Adding %s to world" % db_pkg.cp | 1261 print "Adding %s to world" % db_pkg.cp |
1259 new_world_pkgs.append(db_pkg.cp) | 1262 new_world_pkgs.append(db_pkg.cp) |
1260 if new_world_pkgs: | 1263 if new_world_pkgs: |
1261 world_set.update(new_world_pkgs) | 1264 world_set.update(new_world_pkgs) |
1262 | 1265 |
1263 print "Done" | 1266 print "Done" |
1264 | 1267 |
1265 if __name__ == "__main__": | 1268 if __name__ == "__main__": |
1266 main() | 1269 main() |
OLD | NEW |