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

Unified Diff: parallel_emerge

Issue 3056002: Make the homedir check a bit simpler. (Closed) Base URL: ssh://git@chromiumos-git/crosutils.git
Patch Set: Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: parallel_emerge
diff --git a/parallel_emerge b/parallel_emerge
index 5b09ec6e428f8384160fe9624221555f5b30edc6..ada9657fe94f1cbc8680afa60677f260f985011f 100755
--- a/parallel_emerge
+++ b/parallel_emerge
@@ -60,9 +60,9 @@ import urllib2
# encounter this case unless they have an old chroot or blow away the
# environment by running sudo without the -E specifier.
if "PORTAGE_USERNAME" not in os.environ:
- homedir = os.environ["HOME"]
- if homedir.startswith("/home/"):
- os.environ["PORTAGE_USERNAME"] = homedir.split("/")[2]
+ homedir = os.environ.get("HOME")
+ if homedir:
+ os.environ["PORTAGE_USERNAME"] = os.path.basename(homedir)
# Portage doesn't expose dependency trees in its public API, so we have to
# make use of some private APIs here. These modules are found under
@@ -1025,6 +1025,8 @@ def EmergeWorker(task_queue, done_queue, emerge, package_db):
opts, spinner = emerge.opts, emerge.spinner
opts["--nodeps"] = True
while True:
+ # Wait for a new item to show up on the queue. This is a blocking wait,
+ # so if there's nothing to do, we just sit here.
target = task_queue.get()
print "Emerging", target
db_pkg = package_db[target]
« 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