public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r13878 - main/branches/prefix/pym/portage/dbapi
@ 2009-08-03 17:48 Fabian Groffen (grobian)
  0 siblings, 0 replies; only message in thread
From: Fabian Groffen (grobian) @ 2009-08-03 17:48 UTC (permalink / raw
  To: gentoo-commits

Author: grobian
Date: 2009-08-03 17:48:09 +0000 (Mon, 03 Aug 2009)
New Revision: 13878

Modified:
   main/branches/prefix/pym/portage/dbapi/vartree.py
Log:
try to introduce some readability/efficiency, and try to fix backtrace when no make.profile is there or it is invalid

Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
===================================================================
--- main/branches/prefix/pym/portage/dbapi/vartree.py	2009-08-03 15:51:47 UTC (rev 13877)
+++ main/branches/prefix/pym/portage/dbapi/vartree.py	2009-08-03 17:48:09 UTC (rev 13878)
@@ -1453,10 +1453,12 @@
 			# apparently this user isn't allowed to access PRIVATE_PATH
 			self.plib_registry = None
 
-		if self.settings.get('CHOST').find('darwin') >= 0:
+		chost = self.settings.get('CHOST')
+		if not chost:
+			chost = 'lunix?' # this happens when profiles are not available
+		if chost.find('darwin') >= 0:
 			self.linkmap = LinkageMapMachO(self)
-		elif self.settings.get('CHOST').find('interix') >= 0 \
-				or self.settings.get('CHOST').find('winnt') >= 0:
+		elif chost.find('interix') >= 0 or chost.find('winnt') >= 0:
 			self.linkmap = LinkageMapPeCoff(self)
 		else:
 			self.linkmap = LinkageMap(self)
@@ -3307,10 +3309,10 @@
 		def path_to_node(path):
 			node = path_node_map.get(path)
 			if node is None:
-				if self.settings.get('CHOST').find('darwin') >= 0:
+				chost = self.settings.get('CHOST')
+				if chost.find('darwin') >= 0:
 					node = LinkageMapMachO._LibGraphNode(path, root)
-				elif self.settings.get('CHOST').find('interix') >= 0 \
-						or self.settings.get('CHOST').find('winnt') >= 0:
+				elif chost.find('interix') >= 0 or chost.find('winnt') >= 0:
 					node = LinkageMapPeCoff._LibGraphNode(path, root)
 				else:
 					node = LinkageMap._LibGraphNode(path, root)
@@ -3455,10 +3457,10 @@
 		def path_to_node(path):
 			node = path_node_map.get(path)
 			if node is None:
-				if self.settings.get('CHOST').find('darwin') >= 0:
+				chost = self.settings.get('CHOST')
+				if chost.find('darwin') >= 0:
 					node = LinkageMapMachO._LibGraphNode(path, root)
-				elif self.settings.get('CHOST').find('interix') >= 0 \
-						or self.settings.get('CHOST').find('winnt') >= 0:
+				elif chost.find('interix') >= 0 or chost.find('winnt') >= 0:
 					node = LinkageMapPeCoff._LibGraphNode(path, root)
 				else:
 					node = LinkageMap._LibGraphNode(path, root)




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

only message in thread, other threads:[~2009-08-03 17:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-03 17:48 [gentoo-commits] portage r13878 - main/branches/prefix/pym/portage/dbapi Fabian Groffen (grobian)

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