summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-09 22:53:50 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-09 22:53:50 +0000
commita3d21d02684e255c2ded0be391d21b30c83c671b (patch)
treecbae9d8e7fbd114870bc684e4dcb20eaa67da928
parent48bb94e58ee1f80f7f83d0216348951326b2e385 (diff)
downloadportage-a3d21d02684e255c2ded0be391d21b30c83c671b.tar.gz
portage-a3d21d02684e255c2ded0be391d21b30c83c671b.tar.bz2
portage-a3d21d02684e255c2ded0be391d21b30c83c671b.zip
Bug #261670 - Generate a QA Notice if CHOST (from dyn_install) has a value
which differs from the initial setting. svn path=/main/trunk/; revision=12810
-rw-r--r--pym/portage/dbapi/vartree.py41
1 files changed, 24 insertions, 17 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 63705d27c..8ceff86e6 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3003,6 +3003,15 @@ class dblink(object):
return 1
+ def _eqawarn(self, phase, lines):
+ from portage.elog.messages import eqawarn as _eqawarn
+ if self._scheduler is None:
+ for l in lines:
+ _eqawarn(l, phase=phase, key=self.settings.mycpv)
+ else:
+ self._scheduler.dblinkElog(self,
+ phase, _eqawarn, lines)
+
def _eerror(self, phase, lines):
from portage.elog.messages import eerror as _eerror
if self._scheduler is None:
@@ -3059,29 +3068,27 @@ class dblink(object):
level=logging.ERROR, noiselevel=-1)
return 1
- inforoot_slot_file = os.path.join(inforoot, "SLOT")
- slot = None
- try:
- f = open(inforoot_slot_file)
+ slot = ''
+ for var_name in ('CHOST', 'SLOT'):
try:
- slot = f.read().strip()
- finally:
- f.close()
- except EnvironmentError, e:
- if e.errno != errno.ENOENT:
- raise
- del e
+ val = open(os.path.join(inforoot, var_name)).readline().strip()
+ except EnvironmentError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+ val = ''
- if slot is None:
- slot = ""
+ if var_name == 'SLOT':
+ slot = val
+
+ if val != self.settings.get(var_name, ''):
+ self._eqawarn('preinst',
+ ["QA Notice: Expected %s='%s', got '%s'\n" % \
+ (var_name, self.settings.get(var_name, ''), val)])
def eerror(lines):
self._eerror("preinst", lines)
- if slot != self.settings["SLOT"]:
- showMessage("!!! WARNING: Expected SLOT='%s', got '%s'\n" % \
- (self.settings["SLOT"], slot), level=logging.WARN)
-
if not os.path.exists(self.dbcatdir):
os.makedirs(self.dbcatdir)