tools/python/pkglint/userland.py
changeset 495 4153db6738f5
parent 464 08f94c414553
child 623 15f87c23a86e
equal deleted inserted replaced
494:4d0d11d15b72 495:4153db6738f5
   222 	def __elf_wrong_location_check(self, path):
   222 	def __elf_wrong_location_check(self, path):
   223 		result = None
   223 		result = None
   224 
   224 
   225 		ei = elf.get_info(path)
   225 		ei = elf.get_info(path)
   226 		bits = ei.get("bits")
   226 		bits = ei.get("bits")
       
   227 		type = ei.get("type");
   227                 elems = os.path.dirname(path).split("/")
   228                 elems = os.path.dirname(path).split("/")
   228 
   229 
   229                 if ("amd64" in elems) or ("sparcv9" in elems) or ("64" in elems):
   230                 if ("amd64" in elems) or ("sparcv9" in elems) or ("64" in elems):
   230                     path64 = True
   231                     path64 = True
   231                 else:
   232                 else:
   232                     path64 = False
   233                     path64 = False
       
   234 
       
   235                 if ("i86" in elems) or ("sparcv7" in elems) or ("32" in elems):
       
   236                     path32 = True
       
   237                 else:
       
   238                     path32 = False
       
   239 
       
   240 		# ignore 64-bit executables in normal (non-32-bit-specific)
       
   241 		# locations, that's ok now.
       
   242 		if (type == "exe" and bits == 64 and path32 == False and path64 == False):
       
   243 			return result
   233 
   244 
   234 		if bits == 32 and path64:
   245 		if bits == 32 and path64:
   235 			result = _("32-bit object '%s' in 64-bit path")
   246 			result = _("32-bit object '%s' in 64-bit path")
   236 		elif bits == 64 and not path64:
   247 		elif bits == 64 and not path64:
   237 			result = _("64-bit object '%s' in 32-bit path")
   248 			result = _("64-bit object '%s' in 32-bit path")