[entropy.qa] add broken libraries masking support
This commit is contained in:
2
Makefile
2
Makefile
@@ -37,6 +37,8 @@ entropy-install:
|
||||
install -m 644 conf/fsdirsmask.conf $(DESTDIR)/etc/entropy/
|
||||
install -m 644 conf/brokensyms.conf $(DESTDIR)/etc/entropy/
|
||||
install -m 644 conf/fssymlinks.conf $(DESTDIR)/etc/entropy/
|
||||
install -m 644 conf/brokenlibsmask.conf $(DESTDIR)/etc/entropy/
|
||||
|
||||
install -m 644 conf/repositories.conf.example $(DESTDIR)/etc/entropy/
|
||||
install -m 644 conf/socket* $(DESTDIR)/etc/entropy/
|
||||
install -m 644 conf/entropy.conf $(DESTDIR)/etc/entropy/
|
||||
|
||||
10
conf/brokenlibsmask.conf
Normal file
10
conf/brokenlibsmask.conf
Normal file
@@ -0,0 +1,10 @@
|
||||
# Project Entropy 1.0 Entropy configuration file
|
||||
#
|
||||
# This is part of the broken libraries QA tool.
|
||||
# Such tool will collect broken libraries and will automatically filter out
|
||||
# the ones listed here.
|
||||
# Regular expressions allowed.
|
||||
#
|
||||
|
||||
libnvidia-tls.so.1
|
||||
libGLcore.so.1
|
||||
@@ -359,6 +359,7 @@ class SystemSettings(Singleton):
|
||||
'system_dirs_mask': etpConst['confdir']+"/fsdirsmask.conf",
|
||||
'system_rev_symlinks': etpConst['confdir']+"/fssymlinks.conf",
|
||||
'broken_syms': etpConst['confdir']+"/brokensyms.conf",
|
||||
'broken_libs_mask': etpConst['confdir']+"/brokenlibsmask.conf",
|
||||
'hw_hash': etpConst['confdir']+"/.hw.hash",
|
||||
'socket_service': etpConst['socketconf'],
|
||||
'system': etpConst['entropyconf'],
|
||||
@@ -369,7 +370,7 @@ class SystemSettings(Singleton):
|
||||
'keywords', 'unmask', 'mask', 'satisfied', 'license_mask',
|
||||
'system_mask', 'system_package_sets', 'system_dirs',
|
||||
'system_dirs_mask', 'socket_service', 'system',
|
||||
'system_rev_symlinks', 'hw_hash', 'broken_syms'
|
||||
'system_rev_symlinks', 'hw_hash', 'broken_syms', 'broken_libs_mask'
|
||||
])
|
||||
self.__setting_files_pre_run.extend(['repositories'])
|
||||
|
||||
@@ -865,6 +866,16 @@ class SystemSettings(Singleton):
|
||||
"""
|
||||
return self.__generic_parser(self.__setting_files['broken_syms'])
|
||||
|
||||
def _broken_libs_mask_parser(self):
|
||||
"""
|
||||
Parser returning a list of broken shared libraries which are
|
||||
always considered sane.
|
||||
|
||||
@return: parsed metadata
|
||||
@rtype: dict
|
||||
"""
|
||||
return self.__generic_parser(self.__setting_files['broken_libs_mask'])
|
||||
|
||||
def _hw_hash_parser(self):
|
||||
"""
|
||||
Hardware hash metadata parser and generator. It returns a theorically
|
||||
|
||||
@@ -294,13 +294,20 @@ class QAInterface:
|
||||
|
||||
reverse_symlink_map = self.SystemSettings['system_rev_symlinks']
|
||||
broken_syms_list = self.SystemSettings['broken_syms']
|
||||
broken_libs_mask = self.SystemSettings['broken_libs_mask']
|
||||
|
||||
import re
|
||||
|
||||
broken_syms_list_regexp = []
|
||||
for broken_sym in broken_syms_list:
|
||||
reg_sym = re.compile(broken_sym)
|
||||
broken_syms_list_regexp.append(reg_sym)
|
||||
|
||||
broken_libs_mask_regexp = []
|
||||
for broken_lib in broken_libs_mask:
|
||||
reg_lib = re.compile(broken_lib)
|
||||
broken_libs_mask_regexp.append(reg_lib)
|
||||
|
||||
ldpaths = set(self.entropyTools.collect_linker_paths())
|
||||
ldpaths |= self.entropyTools.collect_paths()
|
||||
|
||||
@@ -411,7 +418,23 @@ class QAInterface:
|
||||
def mymf2(mylib):
|
||||
return not self.resolve_dynamic_library(mylib, executable)
|
||||
|
||||
mylibs = set(filter(mymf2,myelfs))
|
||||
mylibs = set(filter(mymf2, myelfs))
|
||||
|
||||
# filter broken libraries
|
||||
if mylibs:
|
||||
|
||||
mylib_filter = set()
|
||||
for mylib in mylibs:
|
||||
mylib_matched = False
|
||||
for reg_lib in broken_libs_mask_regexp:
|
||||
if reg_lib.match(mylib):
|
||||
mylib_matched = True
|
||||
break
|
||||
if mylib_matched: # filter out
|
||||
mylib_filter.add(mylib)
|
||||
mylibs -= mylib_filter
|
||||
|
||||
|
||||
broken_sym_found = set()
|
||||
if broken_symbols and not mylibs:
|
||||
|
||||
@@ -429,7 +452,7 @@ class QAInterface:
|
||||
continue
|
||||
|
||||
if mylibs:
|
||||
alllibs = blue(' :: ').join(list(mylibs))
|
||||
alllibs = blue(' :: ').join(sorted(mylibs))
|
||||
self.Output.updateProgress(
|
||||
red(etpConst['systemroot']+executable)+" [ "+alllibs+" ]",
|
||||
importance = 1,
|
||||
|
||||
Reference in New Issue
Block a user