commit:     1fb919b834b2ff3f0cdcbdd94402fd5e76dd7e50
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  4 08:07:16 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Jul  4 08:21:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fb919b8

net-analyzer/greenbone-feed-sync: revert "drop config file patching in src_test"

This essentially reverts commit 0375a7b2b589d7ffe2b73a3426d8c0abd4f4b38e, but
adjusts the sed comment to remove the reference to sandbox violations,
because this are not what we are seeing without the sed.

We also now use T to store config.py.orig, as it brings down the line
length.

Furthermore, we keep the "${WORKDIR}/${P}"/ part dropped, as it is
unnecessary.

Closes: https://bugs.gentoo.org/932836
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 .../greenbone-feed-sync-24.3.0-r1.ebuild                    | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git 
a/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0-r1.ebuild 
b/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0-r1.ebuild
index c5178e60a3c3..9e06b6cd11bb 100644
--- a/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0-r1.ebuild
+++ b/net-analyzer/greenbone-feed-sync/greenbone-feed-sync-24.3.0-r1.ebuild
@@ -38,6 +38,16 @@ RDEPEND="
 distutils_enable_tests unittest
 
 src_test() {
+       # Make a copy of the original config
+       cp greenbone/feed/sync/config.py "${T}"/config.py.orig || die
+
+       # Patch the config.py to not use files from /etc/gvm, as this may
+       # cause a PermissionError. See https://bugs.gentoo.org/932836#c10
+       sed -i \
+               -e 's:DEFAULT_CONFIG_FILE = 
"/etc/gvm/greenbone-feed-sync.toml":DEFAULT_CONFIG_FILE = 
"'"${WORKDIR}/${P}-${TARGET}"'/install/etc/gvm/greenbone-feed-sync.toml":' \
+               -e 's:DEFAULT_ENTERPRISE_KEY_PATH = 
"/etc/gvm/greenbone-enterprise-feed-key":DEFAULT_ENTERPRISE_KEY_PATH = 
"'"${WORKDIR}/${P}-${TARGET}"'/install/etc/gvm/greenbone-enterprise-feed-key":' 
\
+               greenbone/feed/sync/config.py || die
+
        # Disable tests that require network access.
        sed -i \
                -e 's:test_do_not_run_as_root:_&:' \
@@ -50,6 +60,9 @@ src_test() {
                        tests/test_main.py || die
 
        distutils-r1_src_test
+
+       # Restore config.py after test.
+       mv "${T}"/config.py.orig greenbone/feed/sync/config.py || die
 }
 
 python_install() {

Reply via email to