Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: parallel_emerge

Issue 3034051: Update parallel_emerge to use no-env-update feature which skips env_update. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Add period. Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 # is quite useful: it checks to make sure that we don't have multiple 320 # is quite useful: it checks to make sure that we don't have multiple
321 # packages that own the same file. The collision-protect feature is more 321 # packages that own the same file. The collision-protect feature is more
322 # strict, and less useful: it fails if it finds a conflicting file, even 322 # strict, and less useful: it fails if it finds a conflicting file, even
323 # if that file was created by an earlier ebuild that failed to install. 323 # if that file was created by an earlier ebuild that failed to install.
324 # 324 #
325 # We want to disable collision-protect here because we don't handle 325 # We want to disable collision-protect here because we don't handle
326 # failures during the merge step very well. Sometimes we leave old files 326 # failures during the merge step very well. Sometimes we leave old files
327 # lying around and they cause problems, so for now we disable the flag. 327 # lying around and they cause problems, so for now we disable the flag.
328 # TODO(davidjames): Look for a better solution. 328 # TODO(davidjames): Look for a better solution.
329 features = os.environ.get("FEATURES", "") + " -collision-protect" 329 features = os.environ.get("FEATURES", "") + " -collision-protect"
330
331 # If we're cross-compiling, updating the environment every time we install
332 # a package isn't necessary, and leads to race conditions. Do environment
333 # updates at the end, instead.
334 if self.board:
335 features = features + " no-env-update"
336
330 os.environ["FEATURES"] = features 337 os.environ["FEATURES"] = features
331 338
332 # Now that we've setup the necessary environment variables, we can load the 339 # Now that we've setup the necessary environment variables, we can load the
333 # emerge config from disk. 340 # emerge config from disk.
334 settings, trees, mtimedb = load_emerge_config() 341 settings, trees, mtimedb = load_emerge_config()
335 342
336 # Check whether our portage tree is out of date. Typically, this happens 343 # Check whether our portage tree is out of date. Typically, this happens
337 # when you're setting up a new portage tree, such as in setup_board and 344 # when you're setting up a new portage tree, such as in setup_board and
338 # make_chroot. In that case, portage applies a bunch of global updates 345 # make_chroot. In that case, portage applies a bunch of global updates
339 # here. Once the updates are finished, we need to commit any changes 346 # here. Once the updates are finished, we need to commit any changes
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 new_world_pkgs = [] 1315 new_world_pkgs = []
1309 root = emerge.settings["ROOT"] 1316 root = emerge.settings["ROOT"]
1310 final_db = emerge.depgraph._dynamic_config.mydbapi[root] 1317 final_db = emerge.depgraph._dynamic_config.mydbapi[root]
1311 for pkg in emerge.cmdline_packages: 1318 for pkg in emerge.cmdline_packages:
1312 for db_pkg in final_db.match_pkgs(pkg): 1319 for db_pkg in final_db.match_pkgs(pkg):
1313 print "Adding %s to world" % db_pkg.cp 1320 print "Adding %s to world" % db_pkg.cp
1314 new_world_pkgs.append(db_pkg.cp) 1321 new_world_pkgs.append(db_pkg.cp)
1315 if new_world_pkgs: 1322 if new_world_pkgs:
1316 world_set.update(new_world_pkgs) 1323 world_set.update(new_world_pkgs)
1317 1324
1325 # Update environment (library cache, symlinks, etc.)
1326 if deps.board and "--pretend" not in emerge.opts:
1327 portage.env_update()
1328
1318 print "Done" 1329 print "Done"
1319 1330
1320 if __name__ == "__main__": 1331 if __name__ == "__main__":
1321 main() 1332 main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698