260 result = _("bad RUNPATH, '%%s' includes '%s'" % |
260 result = _("bad RUNPATH, '%%s' includes '%s'" % |
261 ":".join(list)) |
261 ":".join(list)) |
262 |
262 |
263 return result |
263 return result |
264 |
264 |
265 def __elf_wrong_location_check(self, path): |
265 def __elf_wrong_location_check(self, path, inspath): |
266 result = None |
266 result = None |
267 |
267 |
268 ei = elf.get_info(path) |
268 ei = elf.get_info(path) |
269 bits = ei.get("bits") |
269 bits = ei.get("bits") |
270 type = ei.get("type"); |
270 type = ei.get("type"); |
271 elems = os.path.dirname(path).split("/") |
271 elems = os.path.dirname(inspath).split("/") |
272 |
272 |
273 path64 = False |
273 path64 = False |
274 for p in self.pathlist64: |
274 for p in self.pathlist64: |
275 if (p in elems): |
275 if (p in elems): |
276 path64 = True |
276 path64 = True |
295 """Checks for existence in the proto area.""" |
295 """Checks for existence in the proto area.""" |
296 |
296 |
297 if action.name not in ["file"]: |
297 if action.name not in ["file"]: |
298 return |
298 return |
299 |
299 |
|
300 inspath=action.attrs["path"] |
|
301 |
300 path = action.hash |
302 path = action.hash |
301 if path == None or path == 'NOHASH': |
303 if path == None or path == 'NOHASH': |
302 path = action.attrs["path"] |
304 path = inspath |
303 |
305 |
304 # check for writable files without a preserve attribute |
306 # check for writable files without a preserve attribute |
305 if "mode" in action.attrs: |
307 if "mode" in action.attrs: |
306 mode = action.attrs["mode"] |
308 mode = action.attrs["mode"] |
307 |
309 |
335 _("%s missing from proto area, skipping" |
337 _("%s missing from proto area, skipping" |
336 " content checks") % path, |
338 " content checks") % path, |
337 msgid="%s%s.1" % (self.name, pkglint_id)) |
339 msgid="%s%s.1" % (self.name, pkglint_id)) |
338 elif elf.is_elf_object(fullpath): |
340 elif elf.is_elf_object(fullpath): |
339 # 32/64 bit in wrong place |
341 # 32/64 bit in wrong place |
340 result = self.__elf_wrong_location_check(fullpath) |
342 result = self.__elf_wrong_location_check(fullpath, inspath) |
341 if result != None: |
343 if result != None: |
342 engine.error(result % path, |
344 engine.error(result % inspath, |
343 msgid="%s%s.2" % (self.name, pkglint_id)) |
345 msgid="%s%s.2" % (self.name, pkglint_id)) |
344 result = self.__elf_runpath_check(fullpath, engine) |
346 result = self.__elf_runpath_check(fullpath, engine) |
345 if result != None: |
347 if result != None: |
346 engine.error(result % path, |
348 engine.error(result % path, |
347 msgid="%s%s.3" % (self.name, pkglint_id)) |
349 msgid="%s%s.3" % (self.name, pkglint_id)) |