commit:     02b60328bdfe302f61b5d4abdb07bee0fc1c118c
Author:     Alberto Gireud <agireud <AT> amazon <DOT> com>
AuthorDate: Mon Apr 24 01:33:14 2023 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Mon Apr 24 18:51:32 2023 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=02b60328

Fix config loading if XDG_CONFIG_HOME is defined

Signed-off-by: Alberto Gireud <agireud <AT> amazon.com>
Closes: https://github.com/pkgcore/pkgcheck/pull/573
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 doc/man/config.rst    | 9 +++++----
 src/pkgcheck/const.py | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/man/config.rst b/doc/man/config.rst
index 012804c9..34e9ca5b 100644
--- a/doc/man/config.rst
+++ b/doc/man/config.rst
@@ -4,10 +4,11 @@ Config file support
 Config files are supported by ``pkgcheck scan`` from any of four locations.
 Listed in order of increasing precedence these include the following:
 
-- system config -- /etc/pkgcheck/pkgcheck.conf
-- user config -- ~/.config/pkgcheck/pkgcheck.conf
-- repo config -- metadata/pkgcheck.conf inside an ebuild repo
-- custom config -- specified via the --config option
+- system config -- ``/etc/pkgcheck/pkgcheck.conf``
+- user config -- ``${XDG_CONFIG_HOME}/pkgcheck/pkgcheck.conf``
+- user config -- ``~/.config/pkgcheck/pkgcheck.conf``
+- repo config -- ``metadata/pkgcheck.conf`` inside an ebuild repo
+- custom config -- specified via the ``--config`` option
 
 Any settings from a config file with higher precedence will override matching
 settings from a config file with a lower precedence, e.g. repo settings

diff --git a/src/pkgcheck/const.py b/src/pkgcheck/const.py
index 61b0922f..78ab7fef 100644
--- a/src/pkgcheck/const.py
+++ b/src/pkgcheck/const.py
@@ -32,7 +32,7 @@ for xdg_var, var_name, fallback_dir in (
     setattr(
         _module,
         var_name,
-        os.environ.get(xdg_var, os.path.join(os.path.expanduser(fallback_dir), 
"pkgcheck")),
+        os.path.join(os.environ.get(xdg_var, 
os.path.expanduser(fallback_dir)), "pkgcheck"),
     )
 
 REPO_PATH = _GET_CONST("REPO_PATH", _reporoot)

Reply via email to