tools/python/pkglint/userland.py
changeset 6859 569bef81e3c4
parent 5684 7bc997011220
child 7957 39baccd8f6e8
equal deleted inserted replaced
6858:0f8601e37dad 6859:569bef81e3c4
   372 		ei = elf.get_info(path)
   372 		ei = elf.get_info(path)
   373 		bits = ei.get("bits")
   373 		bits = ei.get("bits")
   374 		type = ei.get("type");
   374 		type = ei.get("type");
   375                 elems = os.path.dirname(inspath).split("/")
   375                 elems = os.path.dirname(inspath).split("/")
   376 
   376 
       
   377 		path32 = False
   377                 path64 = False
   378                 path64 = False
   378 		for p in self.pathlist64:
   379 
   379 		    if (p in elems):
   380 		# Walk through the path elements backward and at the first
       
   381 		# 32/64 bit specific element, flag it and break.
       
   382 		for p in elems[::-1]:
       
   383 		    if (p in self.pathlist32):
       
   384 		    	path32 = True
       
   385 			break
       
   386 		    if (p in self.pathlist64):
   380 		    	path64 = True
   387 		    	path64 = True
   381 
   388 			break
   382 		path32 = False
       
   383 		for p in self.pathlist32:
       
   384 		    if (p in elems):
       
   385 		    	path32 = True
       
   386 
   389 
   387 		# ignore 64-bit executables in normal (non-32-bit-specific)
   390 		# ignore 64-bit executables in normal (non-32-bit-specific)
   388 		# locations, that's ok now.
   391 		# locations, that's ok now.
   389 		if (type == "exe" and bits == 64 and path32 == False and path64 == False):
   392 		if (type == "exe" and bits == 64 and path32 == False and path64 == False):
   390 			return result
   393 			return result
   391 
   394 
   392 		if bits == 32 and path64:
   395 		if bits == 32 and path64:
   393 			result = _("32-bit object '%s' in 64-bit path")
   396 			result = _("32-bit object '%%s' in 64-bit path(%s)" % elems)
   394 		elif bits == 64 and not path64:
   397 		elif bits == 64 and not path64:
   395 			result = _("64-bit object '%s' in 32-bit path")
   398 			result = _("64-bit object '%s' in 32-bit path")
   396 		return result
   399 		return result
   397 
   400 
   398 	def file_action(self, action, manifest, engine, pkglint_id="001"):
   401 	def file_action(self, action, manifest, engine, pkglint_id="001"):