Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 593672 | Differences between
and this patch

Collapse All | Expand All

(-)a/pym/gentoolkit/revdep_rebuild/analyse.py (-10 / +24 lines)
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
227
								os.path.realpath(filename) in self.all_masks or
228
								self.is_masked(os.path.realpath(filename))
229
								):
225
								self.logger.debug('\tFile %s ignored as it is masked' % filename)
230
								self.logger.debug('\tFile %s ignored as it is masked' % filename)
226
								continue
231
								continue
227
							if not bits in found_libs:
232
							if not bits in found_libs:
Lines 240-245 class LibCheck(object): Link Here
240
		return found_libs
245
		return found_libs
241
246
242
247
248
	def is_masked(self, filename):
249
		for m in self.masked_dirs:
250
			t = m.split(os.sep)
251
			f = filename.split(os.sep)
252
			# self.logger.debug("\tis_masked(); %s, %s" % (t, f))
253
			if t == f[:min(len(t), len(f))]:
254
				return True
255
		return False
256
257
243
	def process_results(self, found_libs, scanned_files=None):
258
	def process_results(self, found_libs, scanned_files=None):
244
		'''Processes the search results, logs the files found
259
		'''Processes the search results, logs the files found
245
260
Lines 294-311 def analyse(settings, logger, libraries=None, la_libraries=None, Link Here
294
		]
309
		]
295
	)
310
	)
296
311
312
	if '64' not in searchbits:
313
		masked_dirs.update(['/lib64', '/usr/lib64'])
314
	elif '32' not in searchbits:
315
		masked_dirs.update(['/lib32', '/usr/lib32'])
316
297
	all_masks = masked_dirs.copy()
317
	all_masks = masked_dirs.copy()
298
	all_masks.update(masked_files)
318
	all_masks.update(masked_files)
299
	logger.debug("\tall_masks:")
319
	logger.debug("\tall_masks:")
300
	for x in sorted(all_masks):
320
	for x in sorted(all_masks):
301
		logger.debug('\t\t%s' % (x))
321
		logger.debug('\t\t%s' % (x))
302
322
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:
323
	if libraries and la_libraries and libraries_links and binaries:
310
		logger.info(blue(' * ') +
324
		logger.info(blue(' * ') +
311
			bold('Found a valid cache, skipping collecting phase'))
325
			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))
385
		% (len(libs_and_bins), len(libraries)+len(libraries_links))
372
	)
386
	)
373
387
374
	libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits, all_masks)
388
	libcheck = LibCheck(scanned_files, logger, _libs_to_check, searchbits,
389
						all_masks, masked_dirs)
375
390
376
	broken_pathes = libcheck.process_results(libcheck.search())
391
	broken_pathes = libcheck.process_results(libcheck.search())
377
392
378
- 

Return to bug 593672