gnu: fail2ban: Improve snippet.

* gnu/packages/admin.scm (fail2ban)
  [source]<modules>: Remove (srfi srfi-26).
  <snippet>: Use gexp. Move substitute* patches...
  [arguments]<phases>: ...to phases 'patch-setup.py and 'disable-some-tests.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Nicolas Graves 2025-05-04 10:56:26 +02:00 committed by Ludovic Courtès
parent bbae08827f
commit f8bd2dbbd5
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -6218,23 +6218,19 @@ alias cysdig=sudo csysdig --modern-bpf
"'usr/share/doc/fail2ban'")))) "'usr/share/doc/fail2ban'"))))
(add-after 'unpack 'disable-some-tests (add-after 'unpack 'disable-some-tests
(lambda _ (lambda _
(define (make-suite str) (define (make-suite-regex tests)
(string-append "tests.addTest\\(loadTests\\(" str "\\)\\)")) (string-append "tests.addTest\\(loadTests\\(("
(string-join tests "|")
")\\)\\)"))
;; disable tests performing unacceptable side-effects ;; disable tests performing unacceptable side-effects
(substitute* "fail2ban/tests/utils.py" (substitute* "fail2ban/tests/utils.py"
(((make-suite "actiontestcase.CommandActionTest")) (((make-suite-regex (list "actiontestcase.CommandActionTest"
"") "misctestcase.SetupTest"
(((make-suite "misctestcase.SetupTest")) "filtertestcase.DNSUtilsNetworkTests"
"") "filtertestcase.IgnoreIPDNS"
(((make-suite "filtertestcase.DNSUtilsNetworkTests")) "filtertestcase.GetFailures"
"") "fail2banclienttestcase.Fail2banServerTest"
(((make-suite "filtertestcase.IgnoreIPDNS")) "servertestcase.ServerConfigReaderTests")))
"")
(((make-suite "filtertestcase.GetFailures"))
"")
(((make-suite "fail2banclienttestcase.Fail2banServerTest"))
"")
(((make-suite "servertestcase.ServerConfigReaderTests"))
"")))) ""))))
(add-before 'build 'fix-default-config (add-before 'build 'fix-default-config
(lambda _ (lambda _