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 |
if filename.startswith(m): |
248 |
return True |
249 |
return False |
250 |
|
251 |
|
243 |
def process_results(self, found_libs, scanned_files=None): |
252 |
def process_results(self, found_libs, scanned_files=None): |
244 |
'''Processes the search results, logs the files found |
253 |
'''Processes the search results, logs the files found |
245 |
|
254 |
|
Lines 294-311
def analyse(settings, logger, libraries=None, la_libraries=None,
Link Here
|
294 |
] |
303 |
] |
295 |
) |
304 |
) |
296 |
|
305 |
|
|
|
306 |
if '64' not in searchbits: |
307 |
masked_dirs.update(['/lib64', '/usr/lib64']) |
308 |
elif '32' not in searchbits: |
309 |
masked_dirs.update(['/lib32', '/usr/lib32']) |
310 |
|
297 |
all_masks = masked_dirs.copy() |
311 |
all_masks = masked_dirs.copy() |
298 |
all_masks.update(masked_files) |
312 |
all_masks.update(masked_files) |
299 |
logger.debug("\tall_masks:") |
313 |
logger.debug("\tall_masks:") |
300 |
for x in sorted(all_masks): |
314 |
for x in sorted(all_masks): |
301 |
logger.debug('\t\t%s' % (x)) |
315 |
logger.debug('\t\t%s' % (x)) |
302 |
|
316 |
|
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: |
317 |
if libraries and la_libraries and libraries_links and binaries: |
310 |
logger.info(blue(' * ') + |
318 |
logger.info(blue(' * ') + |
311 |
bold('Found a valid cache, skipping collecting phase')) |
319 |
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)) |
379 |
% (len(libs_and_bins), len(libraries)+len(libraries_links)) |
372 |
) |
380 |
) |
373 |
|
381 |
|
374 |
libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits, all_masks) |
382 |
libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits, |
|
|
383 |
all_masks, masked_dirs) |
375 |
|
384 |
|
376 |
broken_pathes = libcheck.process_results(libcheck.search()) |
385 |
broken_pathes = libcheck.process_results(libcheck.search()) |
377 |
|
386 |
|
378 |
- |
|
|