From patchwork Sun Apr 27 09:08:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Graves X-Patchwork-Id: 42039 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 14A2E27BC49; Sun, 27 Apr 2025 10:10:38 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6382C27BC4B for ; Sun, 27 Apr 2025 10:10:35 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u8y1b-00044k-BG; Sun, 27 Apr 2025 05:10:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u8y1W-00042h-51 for guix-patches@gnu.org; Sun, 27 Apr 2025 05:10:06 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u8y1U-0002vr-Gg for guix-patches@gnu.org; Sun, 27 Apr 2025 05:10:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=JV3UUJiv0HhNNOU0R5r08xnFvraALbnrR10LKhPlArY=; b=nj/LGvB4o2s1Pqww6X+9K6LOk5Wx3F+W+xWAHrM4HO0Rw7eiVgIfhGK8FmFy5RuKAFz8eKUs6Js8uIK4uupIgpvYHoO2y9SiBYxLBgIL9o+DHp45nOaHLGQ6dbg8V5fQqJmKpufvzh1GFMiy3uIFL+wo3/WjXas6dp23hjfJew6pxpIyjJBhSZZHTtygfii0DpoqTXklXym3UG/GwsxY8ZfkNOABVNg9jNtQ/DedHOYBzjrUwt42eVC9MeHI3zEzboXPpKrNLHS6+kuQ+j06Go1P/5eYBNw8EVR0PffUhPaH2LIjPhR68PeUuuYFGW1xVKfWy0elNJly9a8GPTNhHQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1u8y1U-0002Jq-8k for guix-patches@gnu.org; Sun, 27 Apr 2025 05:10:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78066] [PATCH v2 4/5] gnu: fail2ban: Improve snippet. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Apr 2025 09:10:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78066@debbugs.gnu.org Cc: Nicolas Graves Received: via spool by 78066-submit@debbugs.gnu.org id=B78066.17457449928848 (code B ref 78066); Sun, 27 Apr 2025 09:10:04 +0000 Received: (at 78066) by debbugs.gnu.org; 27 Apr 2025 09:09:52 +0000 Received: from localhost ([127.0.0.1]:38997 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u8y1H-0002IX-Rs for submit@debbugs.gnu.org; Sun, 27 Apr 2025 05:09:52 -0400 Received: from 8.mo563.mail-out.ovh.net ([46.105.60.197]:33059) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u8y17-0002HX-Fr for 78066@debbugs.gnu.org; Sun, 27 Apr 2025 05:09:43 -0400 Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net [152.228.215.222]) by mo563.mail-out.ovh.net (Postfix) with ESMTPS id 4Zlgkr4cdsz1Rjp; Sun, 27 Apr 2025 09:09:40 +0000 (UTC) Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net. [127.0.0.1]) by director3.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for <78066@debbugs.gnu.org>; Sun, 27 Apr 2025 09:09:40 +0000 (UTC) Received: from mta2.priv.ovhmail-u1.ea.mail.ovh.net (unknown [10.110.188.184]) by director3.derp.mail-out.ovh.net (Postfix) with ESMTPS id 4Zlgkr3nz7z7wVj; Sun, 27 Apr 2025 09:09:40 +0000 (UTC) Received: from ngraves.fr (unknown [10.1.6.5]) by mta2.priv.ovhmail-u1.ea.mail.ovh.net (Postfix) with ESMTPSA id BEAABBA3F3A; Sun, 27 Apr 2025 09:09:39 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-111S00570d6064e-e549-4a09-9b9e-448fba730604, 9AB25D737CCC7858AAE0948041C432A519AE1DDE) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 89.207.171.153 Date: Sun, 27 Apr 2025 11:08:11 +0200 Message-ID: <20250427090915.11846-5-ngraves@ngraves.fr> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250427090915.11846-1-ngraves@ngraves.fr> References: <20250427090915.11846-1-ngraves@ngraves.fr> MIME-Version: 1.0 X-Ovh-Tracer-Id: 17605696847177769698 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvheejieekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppeduvdejrddtrddtrddupdekledrvddtjedrudejuddrudehfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeektdeiieesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpoffvtefjohhsthepmhhoheeifegmpdhmohguvgepshhmthhpohhuth DKIM-Signature: a=rsa-sha256; bh=JV3UUJiv0HhNNOU0R5r08xnFvraALbnrR10LKhPlArY=; c=relaxed/relaxed; d=ngraves.fr; h=From; s=ovhmo4487190-selector1; t=1745744980; v=1; b=U2KpleQ1Q99xTfsMqJCXwdMooMQ/xlGcT/mLxjz48iUScway2wXSwtWKmTBDCyBh8pLUzz/k OR1JNJioUzTDo7yFWh7TI57uM8UfZLSygVpWk0+OXcGiHUndncYTCfYgilg2KCSpz83NXdIubcj sayDTKfecgKbRIwKtWU7fAG1gVi+5XWKmZ4YPmM6mVsibKeq6h3JFNUrGAEX0ITFg0K88makSuW 1gFJB44kdbLGR4IX4ooNSrNoZpjre+Iea40hLYfxYpVJBos18C5Udq9Yh6te38FKbMiPQej7IJC BSWTsyDZpI1bGdwjQyIocEfVEABojtCkCbbH6FkY9d8mg== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Patchwork-Original-From: Nicolas Graves via Guix-patches via From: Nicolas Graves Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/admin.scm (fail2ban) [source]: Remove (srfi srfi-26). : Use gexp. Move substitute* patches... [arguments]: ...to phases 'patch-setup.py and 'disable-some-tests. --- gnu/packages/admin.scm | 127 +++++++++++++++++++++-------------------- 1 file changed, 64 insertions(+), 63 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 1f48eb264d..25bce63aaf 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -6241,69 +6241,36 @@ (define-public fail2ban (file-name (git-file-name name version)) (sha256 (base32 "0lfakna6ad2xwz95sjxzkavipcsxiy7ybavkdkf9zzmspf2ws4yk")) - (modules '((guix build utils) - (srfi srfi-26))) - (snippet '(begin - ;; deleting things that are not feasible to fix - ;; or won't be used any way - (with-directory-excursion "config" - (for-each delete-file - '("paths-arch.conf" "paths-debian.conf" - "paths-fedora.conf" "paths-freebsd.conf" - "paths-opensuse.conf" "paths-osx.conf"))) - (with-directory-excursion "config/action.d" - (for-each delete-file - '("apf.conf" "bsd-ipfw.conf" - "dshield.conf" - "ipfilter.conf" - "ipfw.conf" - "firewallcmd-allports.conf" - "firewallcmd-common.conf" - "firewallcmd-ipset.conf" - "firewallcmd-multiport.conf" - "firewallcmd-new.conf" - "firewallcmd-rich-logging.conf" - "firewallcmd-rich-rules.conf" - "osx-afctl.conf" - "osx-ipfw.conf" - "pf.conf" - "nginx-block-map.conf" - "npf.conf" - "shorewall.conf" - "shorewall-ipset-proto6.conf" - "ufw.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 (cut string-append - "tests.addTest\\(loadTests\\(" <> - "\\)\\)"))) - (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")) - ""))))) + (modules '((guix build utils))) + (snippet #~(begin + ;; deleting things that are not feasible to fix + ;; or won't be used any way + (with-directory-excursion "config" + (for-each delete-file + '("paths-arch.conf" "paths-debian.conf" + "paths-fedora.conf" "paths-freebsd.conf" + "paths-opensuse.conf" "paths-osx.conf"))) + (with-directory-excursion "config/action.d" + (for-each delete-file + '("apf.conf" "bsd-ipfw.conf" + "dshield.conf" + "ipfilter.conf" + "ipfw.conf" + "firewallcmd-allports.conf" + "firewallcmd-common.conf" + "firewallcmd-ipset.conf" + "firewallcmd-multiport.conf" + "firewallcmd-new.conf" + "firewallcmd-rich-logging.conf" + "firewallcmd-rich-rules.conf" + "osx-afctl.conf" + "osx-ipfw.conf" + "pf.conf" + "nginx-block-map.conf" + "npf.conf" + "shorewall.conf" + "shorewall-ipset-proto6.conf" + "ufw.conf"))))) (patches (search-patches "fail2ban-paths-guix-conf.patch")))) (build-system pyproject-build-system) (arguments @@ -6316,6 +6283,40 @@ (define-public fail2ban (substitute* '("bin/fail2ban-testcases" "setup.py") ((".*updatePyExec.*") "")))) + (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\\(loadTests\\(" 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 _ (substitute* '("config/paths-common.conf"