summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-07-18 07:47:12 +0000
committerZac Medico <zmedico@gentoo.org>2008-07-18 07:47:12 +0000
commit4df9b526bcf31fb703fa9231f283c778e772c1a8 (patch)
treeccdc5bd4d7e6e125a273031d8e39f310ecf816ef
parentff702cfa8348bd9b04fcc63068967dbe93b0fe75 (diff)
downloadportage-4df9b526bcf31fb703fa9231f283c778e772c1a8.tar.gz
portage-4df9b526bcf31fb703fa9231f283c778e772c1a8.tar.bz2
portage-4df9b526bcf31fb703fa9231f283c778e772c1a8.zip
Suppress counter initialization warning messages in
vardbapi.get_counter_tick_core() in cases when the vdb is empty. This avoids pointless error messages when merging packages into a new root, like when building stage 1. svn path=/main/trunk/; revision=11123
-rw-r--r--pym/portage/dbapi/vartree.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index b6b2dbf1a..f9e3fc9ed 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -846,13 +846,16 @@ class vardbapi(dbapi):
if counter > max_counter:
max_counter = counter
+ new_vdb = False
counter = -1
try:
cfile = open(self._counter_path, "r")
except EnvironmentError, e:
- writemsg("!!! Unable to read COUNTER file: '%s'\n" % \
- self._counter_path, noiselevel=-1)
- writemsg("!!! %s\n" % str(e), noiselevel=-1)
+ new_vdb = not bool(self.cpv_all())
+ if not new_vdb:
+ writemsg("!!! Unable to read COUNTER file: '%s'\n" % \
+ self._counter_path, noiselevel=-1)
+ writemsg("!!! %s\n" % str(e), noiselevel=-1)
del e
else:
try:
@@ -877,7 +880,7 @@ class vardbapi(dbapi):
if counter > max_counter:
max_counter = counter
- if counter < 0:
+ if counter < 0 and not new_vdb:
writemsg("!!! Initializing COUNTER to " + \
"value of %d\n" % max_counter, noiselevel=-1)