Lines 120-126
def extract_dependencies_from_la(la, libraries, to_check, logger):
Link Here
|
120 |
|
120 |
|
121 |
|
121 |
|
122 |
class LibCheck(object): |
122 |
class LibCheck(object): |
123 |
def __init__(self, scanned_files, logger, searchlibs=None, searchbits=None, all_masks=None): |
123 |
def __init__(self, scanned_files, logger, searchlibs=None, searchbits=None, |
|
|
124 |
all_masks=None, masked_dirs=None): |
124 |
'''LibCheck init function. |
125 |
'''LibCheck init function. |
125 |
|
126 |
|
126 |
@param scanned_files: optional dictionary if the type created by |
127 |
@param scanned_files: optional dictionary if the type created by |
Lines 135-140
class LibCheck(object):
Link Here
|
135 |
self.searchlibs = searchlibs |
136 |
self.searchlibs = searchlibs |
136 |
self.searchbits = sorted(searchbits) or ['32', '64'] |
137 |
self.searchbits = sorted(searchbits) or ['32', '64'] |
137 |
self.all_masks = all_masks |
138 |
self.all_masks = all_masks |
|
|
139 |
self.masked_dirs = masked_dirs |
138 |
self.logger.debug("\tLibCheck.__init__(), new searchlibs: %s" %(self.searchbits)) |
140 |
self.logger.debug("\tLibCheck.__init__(), new searchlibs: %s" %(self.searchbits)) |
139 |
if searchlibs: |
141 |
if searchlibs: |
140 |
self.smsg = '\tLibCheck.search(), Checking for %s bit dependants' |
142 |
self.smsg = '\tLibCheck.search(), Checking for %s bit dependants' |
Lines 221-227
class LibCheck(object):
Link Here
|
221 |
if l in self.all_masks: |
223 |
if l in self.all_masks: |
222 |
self.logger.debug('\tLibrary %s ignored as it is masked' % l) |
224 |
self.logger.debug('\tLibrary %s ignored as it is masked' % l) |
223 |
continue |
225 |
continue |
224 |
if filename in self.all_masks: |
226 |
if filename in self.all_masks or self.is_masked(filename): |
225 |
self.logger.debug('\tFile %s ignored as it is masked' % filename) |
227 |
self.logger.debug('\tFile %s ignored as it is masked' % filename) |
226 |
continue |
228 |
continue |
227 |
if not bits in found_libs: |
229 |
if not bits in found_libs: |
Lines 240-245
class LibCheck(object):
Link Here
|
240 |
return found_libs |
242 |
return found_libs |
241 |
|
243 |
|
242 |
|
244 |
|
|
|
245 |
def is_masked(self, filename): |
246 |
for m in self.masked_dirs: |
247 |
t = m.split(os.sep) |
248 |
f = filename.split(os.sep) |
249 |
self.logger.debug("\tis_masked(); %t, %f", t, f) |
250 |
if t == f[:min(len(t), len(f))]: |
251 |
return True |
252 |
return False |
253 |
|
254 |
|
243 |
def process_results(self, found_libs, scanned_files=None): |
255 |
def process_results(self, found_libs, scanned_files=None): |
244 |
'''Processes the search results, logs the files found |
256 |
'''Processes the search results, logs the files found |
245 |
|
257 |
|
Lines 294-311
def analyse(settings, logger, libraries=None, la_libraries=None,
Link Here
|
294 |
] |
306 |
] |
295 |
) |
307 |
) |
296 |
|
308 |
|
|
|
309 |
if '64' not in searchbits: |
310 |
masked_dirs.update(['/lib64', '/usr/lib64']) |
311 |
elif '32' not in searchbits: |
312 |
masked_dirs.update(['/lib32', '/usr/lib32']) |
313 |
|
297 |
all_masks = masked_dirs.copy() |
314 |
all_masks = masked_dirs.copy() |
298 |
all_masks.update(masked_files) |
315 |
all_masks.update(masked_files) |
299 |
logger.debug("\tall_masks:") |
316 |
logger.debug("\tall_masks:") |
300 |
for x in sorted(all_masks): |
317 |
for x in sorted(all_masks): |
301 |
logger.debug('\t\t%s' % (x)) |
318 |
logger.debug('\t\t%s' % (x)) |
302 |
|
319 |
|
303 |
|
|
|
304 |
if '64' not in searchbits: |
305 |
masked_dirs.update(['/lib64', '/usr/lib64']) |
306 |
elif '32' not in searchbits: |
307 |
masked_dirs.update(['/lib32', '/usr/lib32']) |
308 |
|
309 |
if libraries and la_libraries and libraries_links and binaries: |
320 |
if libraries and la_libraries and libraries_links and binaries: |
310 |
logger.info(blue(' * ') + |
321 |
logger.info(blue(' * ') + |
311 |
bold('Found a valid cache, skipping collecting phase')) |
322 |
bold('Found a valid cache, skipping collecting phase')) |
Lines 371-377
def analyse(settings, logger, libraries=None, la_libraries=None,
Link Here
|
371 |
% (len(libs_and_bins), len(libraries)+len(libraries_links)) |
382 |
% (len(libs_and_bins), len(libraries)+len(libraries_links)) |
372 |
) |
383 |
) |
373 |
|
384 |
|
374 |
libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits, all_masks) |
385 |
libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits, |
|
|
386 |
all_masks, masked_dirs) |
375 |
|
387 |
|
376 |
broken_pathes = libcheck.process_results(libcheck.search()) |
388 |
broken_pathes = libcheck.process_results(libcheck.search()) |
377 |
|
389 |
|
378 |
- |
|
|