summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-12 02:33:40 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-12 02:33:40 +0000
commit3a5f35717fde787f4253520eedcfb03d7746bcab (patch)
tree322cb7027a4ce3706ddfd4a7d52888a88b281f01
parent210aacd80a6eb9987fe28198b0d73804dc882365 (diff)
downloadportage-3a5f35717fde787f4253520eedcfb03d7746bcab.tar.gz
portage-3a5f35717fde787f4253520eedcfb03d7746bcab.tar.bz2
portage-3a5f35717fde787f4253520eedcfb03d7746bcab.zip
Disable "waiting for lock" messages when in background mode. Thanks to Thargor
for reporting. svn path=/main/trunk/; revision=11400
-rw-r--r--pym/_emerge/__init__.py2
-rw-r--r--pym/portage/locks.py10
2 files changed, 11 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index e194f948f..fae5064e1 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -9599,6 +9599,7 @@ class Scheduler(PollScheduler):
self._add_packages()
pkg_queue = self._pkg_queue
failed_pkgs = self._failed_pkgs
+ portage.locks._quiet = self._background
portage.elog._emerge_elog_listener = self._elog_listener
rval = os.EX_OK
@@ -9606,6 +9607,7 @@ class Scheduler(PollScheduler):
self._main_loop()
finally:
self._main_loop_cleanup()
+ portage.locks._quiet = False
portage.elog._emerge_elog_listener = None
if failed_pkgs:
rval = failed_pkgs[-1].returncode
diff --git a/pym/portage/locks.py b/pym/portage/locks.py
index 000cd3495..4be13c11b 100644
--- a/pym/portage/locks.py
+++ b/pym/portage/locks.py
@@ -13,6 +13,10 @@ from portage.localization import _
HARDLINK_FD = -2
+# Used by emerge in order to disable the "waiting for lock" message
+# so that it doesn't interfere with the status display.
+_quiet = False
+
def lockdir(mydir):
return lockfile(mydir,wantnewlockfile=1)
def unlockdir(mylock):
@@ -83,7 +87,11 @@ def lockfile(mypath, wantnewlockfile=0, unlinkfile=0,
# resource temp unavailable; eg, someone beat us to the lock.
if flags & os.O_NONBLOCK:
raise TryAgain(mypath)
- if waiting_msg is None:
+
+ global _quiet
+ if _quiet:
+ pass
+ elif waiting_msg is None:
if isinstance(mypath, int):
print "waiting for lock on fd %i" % myfd
else: