44 path = os.getenv('PROTO_PATH') |
44 path = os.getenv('PROTO_PATH') |
45 if path != None: |
45 if path != None: |
46 self.proto_path = path.split() |
46 self.proto_path = path.split() |
47 else: |
47 else: |
48 self.proto_path = None |
48 self.proto_path = None |
|
49 # |
|
50 # These lists are used to check if a 32/64-bit binary |
|
51 # is in a proper 32/64-bit directory. |
|
52 # |
|
53 self.pathlist32 = [ |
|
54 "i86", |
|
55 "sparcv7", |
|
56 "32", |
|
57 "i86pc-solaris-64int", # perl path |
|
58 "sun4-solaris-64int" # perl path |
|
59 ] |
|
60 self.pathlist64 = [ |
|
61 "amd64", |
|
62 "sparcv9", |
|
63 "64", |
|
64 "i86pc-solaris-64", # perl path |
|
65 "sun4-solaris-64" # perl path |
|
66 ] |
49 self.runpath_re = [ |
67 self.runpath_re = [ |
50 re.compile('^/lib(/.*)?$'), |
68 re.compile('^/lib(/.*)?$'), |
51 re.compile('^/usr/'), |
69 re.compile('^/usr/'), |
52 re.compile('^\$ORIGIN/') |
70 re.compile('^\$ORIGIN/') |
53 ] |
71 ] |
54 self.runpath_64_re = [ |
72 self.runpath_64_re = [ |
55 re.compile('^.*/64(/.*)?$'), |
73 re.compile('^.*/64(/.*)?$'), |
56 re.compile('^.*/amd64(/.*)?$'), |
74 re.compile('^.*/amd64(/.*)?$'), |
57 re.compile('^.*/sparcv9(/.*)?$') |
75 re.compile('^.*/sparcv9(/.*)?$'), |
|
76 re.compile('^.*/i86pc-solaris-64(/.*)?$'), # perl path |
|
77 re.compile('^.*/sun4-solaris-64(/.*)?$') # perl path |
58 ] |
78 ] |
59 self.initscript_re = re.compile("^etc/(rc.|init)\.d") |
79 self.initscript_re = re.compile("^etc/(rc.|init)\.d") |
60 |
80 |
61 self.lint_paths = {} |
81 self.lint_paths = {} |
62 self.ref_paths = {} |
82 self.ref_paths = {} |
282 ei = elf.get_info(path) |
302 ei = elf.get_info(path) |
283 bits = ei.get("bits") |
303 bits = ei.get("bits") |
284 type = ei.get("type"); |
304 type = ei.get("type"); |
285 elems = os.path.dirname(path).split("/") |
305 elems = os.path.dirname(path).split("/") |
286 |
306 |
287 if ("amd64" in elems) or ("sparcv9" in elems) or ("64" in elems): |
307 path64 = False |
288 path64 = True |
308 for p in self.pathlist64: |
289 else: |
309 if (p in elems): |
290 path64 = False |
310 path64 = True |
291 |
311 |
292 if ("i86" in elems) or ("sparcv7" in elems) or ("32" in elems): |
312 path32 = False |
293 path32 = True |
313 for p in self.pathlist32: |
294 else: |
314 if (p in elems): |
295 path32 = False |
315 path32 = True |
296 |
316 |
297 # ignore 64-bit executables in normal (non-32-bit-specific) |
317 # ignore 64-bit executables in normal (non-32-bit-specific) |
298 # locations, that's ok now. |
318 # locations, that's ok now. |
299 if (type == "exe" and bits == 64 and path32 == False and path64 == False): |
319 if (type == "exe" and bits == 64 and path32 == False and path64 == False): |
300 return result |
320 return result |