guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#78066] [PATCH v3 2/6] gnu: fail2ban: Move setup and test patches to


From: Nicolas Graves
Subject: [bug#78066] [PATCH v3 2/6] gnu: fail2ban: Move setup and test patches to phases.
Date: Sun, 4 May 2025 10:56:22 +0200

* gnu/packages/admin.scm (fail2ban)
  [source]<snippet>: Move setup and test substitutions...
  [arguments]<phases>: ...to phases 'patch-setup.py and
  'disable-some-tests.
---
 gnu/packages/admin.scm | 71 +++++++++++++++++++++---------------------
 1 file changed, 35 insertions(+), 36 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 216776e62c..d47a1935c3 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -6193,42 +6193,7 @@ (define-public fail2ban
                                 "paths-fedora.conf"
                                 "paths-freebsd.conf"
                                 "paths-opensuse.conf"
-                                "paths-osx.conf")))
-                  ;; Get rid of absolute file names.
-                  (substitute* "setup.py"
-                    (("/etc/fail2ban")
-                     "etc/fail2ban")
-                    (("/var/lib/fail2ban")
-                     "var/lib/fail2ban")
-                    (("\"/usr/bin/\"")
-                     "\"usr/bin/\"")
-                    (("\"/usr/lib/fail2ban/\"")
-                     "\"usr/lib/fail2ban/\"")
-                    (("'/usr/share/doc/fail2ban'")
-                     "'usr/share/doc/fail2ban'"))
-                  ;; disable tests performing unacceptable side-effects
-                  (let ((make-suite (lambda (t)
-                                      (string-append
-                                       "tests.addTest.unittest.makeSuite."
-                                       t ".."))))
-                    (substitute* "fail2ban/tests/utils.py"
-                      (((make-suite "actiontestcase.CommandActionTest"))
-                       "")
-                      (((make-suite "misctestcase.SetupTest"))
-                       "")
-                      (((make-suite
-                         "filtertestcase.DNSUtilsNetworkTests"))
-                       "")
-                      (((make-suite "filtertestcase.IgnoreIPDNS"))
-                       "")
-                      (((make-suite "filtertestcase.GetFailures"))
-                       "")
-                      (((make-suite
-                         "fail2banclienttestcase.Fail2banServerTest"))
-                       "")
-                      (((make-suite
-                         "servertestcase.ServerConfigReaderTests"))
-                       "")))))
+                                "paths-osx.conf")))))
               (patches (search-patches
                         "fail2ban-0.11.2_fix-setuptools-drop-2to3.patch"
                         "fail2ban-python310-server-action.patch"
@@ -6243,6 +6208,40 @@ (define-public fail2ban
                   (add-before 'build 'invoke-2to3
                     (lambda _
                       (invoke "./fail2ban-2to3")))
+                  (add-after 'unpack 'patch-setup.py
+                    (lambda _
+                      ;; Get rid of absolute file names.
+                      (substitute* "setup.py"
+                        (("/etc/fail2ban")
+                         "etc/fail2ban")
+                        (("/var/lib/fail2ban")
+                         "var/lib/fail2ban")
+                        (("\"/usr/bin/\"")
+                         "\"usr/bin/\"")
+                        (("\"/usr/lib/fail2ban/\"")
+                         "\"usr/lib/fail2ban/\"")
+                        (("'/usr/share/doc/fail2ban'")
+                         "'usr/share/doc/fail2ban'"))))
+                  (add-after 'unpack 'disable-some-tests
+                    (lambda _
+                      (define (make-suite str)
+                        (string-append "tests.addTest.unittest.makeSuite." str 
".."))
+                      ;; disable tests performing unacceptable side-effects
+                      (substitute* "fail2ban/tests/utils.py"
+                        (((make-suite "actiontestcase.CommandActionTest"))
+                         "")
+                        (((make-suite "misctestcase.SetupTest"))
+                         "")
+                        (((make-suite "filtertestcase.DNSUtilsNetworkTests"))
+                         "")
+                        (((make-suite "filtertestcase.IgnoreIPDNS"))
+                         "")
+                        (((make-suite "filtertestcase.GetFailures"))
+                         "")
+                        (((make-suite 
"fail2banclienttestcase.Fail2banServerTest"))
+                         "")
+                        (((make-suite 
"servertestcase.ServerConfigReaderTests"))
+                         ""))))
                   (add-before 'install 'fix-default-config
                     (lambda* (#:key outputs #:allow-other-keys)
                       (substitute* '("config/paths-common.conf"
-- 
2.49.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]