From 4e3b7b98d36f9222c46c330a92c5dff574cba09e Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 6 Aug 2011 18:08:21 +0200 Subject: [PATCH] [entropy.qa] add support for externally inferred (via config files) broken libraries for test_missing_runtime_libraries() --- Makefile | 1 + conf/brokenlinksmask.conf | 19 +++++++++++++++++++ libraries/entropy/core/settings/base.py | 13 ++++++++++++- libraries/entropy/qa.py | 14 ++++++++++---- 4 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 conf/brokenlinksmask.conf diff --git a/Makefile b/Makefile index adad6222e..648361fdf 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ entropy-install: 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/brokenlinksmask.conf $(DESTDIR)/etc/entropy/ install -m 644 conf/repositories.conf.example $(DESTDIR)/etc/entropy/ install -m 644 conf/entropy.conf $(DESTDIR)/etc/entropy/ diff --git a/conf/brokenlinksmask.conf b/conf/brokenlinksmask.conf new file mode 100644 index 000000000..e2f527765 --- /dev/null +++ b/conf/brokenlinksmask.conf @@ -0,0 +1,19 @@ +# Project Entropy 1.0 Entropy configuration file +# +# This is part of the broken runtime linking QA tool. +# Such tool will collect broken library linking (packages which required +# libraries are not provided by any package in repositories). +# Used by: entropy.qa.QA.test_missing_runtime_libraries() +# +# Please list, one per line, known broken library linkings. +# For example, libGL.so.1 is usually provided by many packages but none +# of them are actually installing it into its final path, because the +# OpenGL implementation is handled through an external tool, which takes care +# of setting up proper library symlinks. + +libGL.so.1 +libGLU.so.1 +libm.so.6 +libpthread.so.0 +libgcc_s.so.1 +libdl.so.2 \ No newline at end of file diff --git a/libraries/entropy/core/settings/base.py b/libraries/entropy/core/settings/base.py index b0bb45707..732fdb030 100644 --- a/libraries/entropy/core/settings/base.py +++ b/libraries/entropy/core/settings/base.py @@ -220,6 +220,7 @@ class SystemSettings(Singleton, EntropyPluginStore): 'system_rev_symlinks': etpConst['confdir']+"/fssymlinks.conf", 'broken_syms': etpConst['confdir']+"/brokensyms.conf", 'broken_libs_mask': etpConst['confdir']+"/brokenlibsmask.conf", + 'broken_links_mask': etpConst['confdir']+"/brokenlinksmask.conf", 'hw_hash': etpConst['confdir']+"/.hw.hash", 'system': etpConst['entropyconf'], 'repositories': etpConst['repositoriesconf'], @@ -230,7 +231,7 @@ class SystemSettings(Singleton, EntropyPluginStore): 'license_accept', 'system_mask', 'system_package_sets', 'system_dirs', 'system_dirs_mask', 'extra_ldpaths', 'system', 'system_rev_symlinks', 'hw_hash', - 'broken_syms', 'broken_libs_mask' + 'broken_syms', 'broken_libs_mask', 'broken_links_mask' ]) self.__setting_files_pre_run.extend(['repositories']) @@ -800,6 +801,16 @@ class SystemSettings(Singleton, EntropyPluginStore): """ return self.__generic_parser(self.__setting_files['broken_libs_mask']) + def _broken_links_mask_parser(self): + """ + Parser returning a list of broken library linking libraries which are + always considered sane. + + @return: parsed metadata + @rtype: dict + """ + return self.__generic_parser(self.__setting_files['broken_links_mask']) + def _hw_hash_parser(self): """ Hardware hash metadata parser and generator. It returns a theorically diff --git a/libraries/entropy/qa.py b/libraries/entropy/qa.py index 0a2b60624..33ae68847 100644 --- a/libraries/entropy/qa.py +++ b/libraries/entropy/qa.py @@ -447,6 +447,11 @@ class QAInterface(TextInterface, EntropyPluginStore): missing_sonames = set() if excluded_libraries is None: excluded_libraries = set() + else: + excluded_libraries = set(excluded_libraries) + + # update content taken from brokenlinksmask.conf + excluded_libraries.update(self._settings['broken_links_mask']) def _resolve_needed_content_fallback(repo, pkg_id, library): # at this point, perhaps the library is self contained in the @@ -540,12 +545,12 @@ class QAInterface(TextInterface, EntropyPluginStore): if not silent: self.output( - "[%s] %s %s: %s, ELF class: %s" % ( + "[%s] %s %s: %s, class: %s" % ( purple(repository_id), teal(atom), purple(_("requires")), brown(library), - elfclass, + darkgreen(str(elfclass)), ), importance = 1, level = "warning", @@ -584,9 +589,10 @@ class QAInterface(TextInterface, EntropyPluginStore): self.output("", level = "info", importance = 0) else: self.output( - _("no missing runtime libraries found"), + darkgreen(_("no missing runtime libraries found")), level = "info", - importance = 1) + importance = 1 + ) return missing_sonames