diff --git a/colin/core/ruleset/ruleset.py b/colin/core/ruleset/ruleset.py index 89a300f..ba52a4a 100644 --- a/colin/core/ruleset/ruleset.py +++ b/colin/core/ruleset/ruleset.py @@ -216,11 +216,17 @@ def get_ruleset_dirs(): logger.debug("Local ruleset directory found ('%s').", local_share) ruleset_dirs.append(local_share) - usr_local_share = os.path.join(sys.prefix, RULESET_DIRECTORY) + usr_local_share = os.path.join("/usr/local", RULESET_DIRECTORY) if os.path.isdir(usr_local_share): logger.debug("Global ruleset directory found ('%s').", usr_local_share) ruleset_dirs.append(usr_local_share) + if sys.prefix != "/usr/local": + global_share = os.path.join(sys.prefix, RULESET_DIRECTORY) + if os.path.isdir(global_share): + logger.debug("Global ruleset directory found ('%s').", global_share) + ruleset_dirs.append(global_share) + if not ruleset_dirs: msg = "Ruleset directory cannot be found." logger.warning(msg) diff --git a/docs/list_of_checks.rst b/docs/list_of_checks.rst index adaa620..f15ae01 100644 --- a/docs/list_of_checks.rst +++ b/docs/list_of_checks.rst @@ -49,6 +49,7 @@ Colin can use ruleset-files in the following directories: - ``./rulesets/`` (subdirectory of the current working directory) - ``~/.local/share/colin/rulesets/`` (user installation) +- ``/usr/local/share/colin/rulesets/`` (system-wide installation if `sys.prefix` is not `/usr/local`) - `sys.prefix`_\ ``/share/colin/rulesets/`` (system-wide installation) .. _sys.prefix: https://docs.python.org/3/library/sys.html?highlight=sys%20prefix#sys.prefix