public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r13042 - main/branches/2.1.6/pym/portage/dbapi
@ 2009-03-11  7:40 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-03-11  7:40 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-03-11 07:40:25 +0000 (Wed, 11 Mar 2009)
New Revision: 13042

Modified:
   main/branches/2.1.6/pym/portage/dbapi/vartree.py
Log:
Bug #261670 - Generate a QA Notice if CHOST (from dyn_install) has a value
which differs from the initial setting. (trunk r12810)

Modified: main/branches/2.1.6/pym/portage/dbapi/vartree.py
===================================================================
--- main/branches/2.1.6/pym/portage/dbapi/vartree.py	2009-03-11 07:40:10 UTC (rev 13041)
+++ main/branches/2.1.6/pym/portage/dbapi/vartree.py	2009-03-11 07:40:25 UTC (rev 13042)
@@ -1986,6 +1986,15 @@
 
 		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:
@@ -2042,29 +2051,27 @@
 				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)
 




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-11  7:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11  7:40 [gentoo-commits] portage r13042 - main/branches/2.1.6/pym/portage/dbapi Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox