From patchwork Sat Apr 6 01:05:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sent X-Patchwork-Id: 62759 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 BCF9427BBE9; Sat, 6 Apr 2024 02:12:20 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 1B90027BBE2 for ; Sat, 6 Apr 2024 02:12:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsubC-0003vK-IT; Fri, 05 Apr 2024 21:12:02 -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 1rsubA-0003v3-MW for guix-patches@gnu.org; Fri, 05 Apr 2024 21:12:00 -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 1rsub9-0001AZ-M1; Fri, 05 Apr 2024 21:11:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rsubC-0000wr-ER; Fri, 05 Apr 2024 21:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70226] [PATCH] scripts: package: Disable searching with the empty string Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 06 Apr 2024 01:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70226 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70226@debbugs.gnu.org Cc: Richard Sent , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by submit@debbugs.gnu.org id=B.17123658653378 (code B ref -1); Sat, 06 Apr 2024 01:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 6 Apr 2024 01:11:05 +0000 Received: from localhost ([127.0.0.1]:37835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsuaG-0000sP-RI for submit@debbugs.gnu.org; Fri, 05 Apr 2024 21:11:05 -0400 Received: from lists.gnu.org ([2001:470:142::17]:44374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsuaB-0000rE-RU for submit@debbugs.gnu.org; Fri, 05 Apr 2024 21:11:03 -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 1rsua0-0003nr-2w for guix-patches@gnu.org; Fri, 05 Apr 2024 21:10:48 -0400 Received: from mail-108-mta226.mxroute.com ([136.175.108.226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsuZx-0000Df-QG for guix-patches@gnu.org; Fri, 05 Apr 2024 21:10:47 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta226.mxroute.com (ZoneMTA) with ESMTPSA id 18eb0f5225e0003bea.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sat, 06 Apr 2024 01:10:38 +0000 X-Zone-Loop: d2f5586ca985caaf9756db1ce590ab98a8dd92a91c90 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6feALBtLJyjd7h0Je59eHFatwcz6OS7HYOkpa80q/h0=; b=ZbIzjW+1amsy0o6trpgaZ5W9ps oXqQQQZOQch9nObNrZvuyg6oiwMpvoDg2wxJ0jnV4Rvgou8lTnneW4l22TRJ1s/J42fX604anmF8k uPYN6eMMsvzQ9qOzmHrEKSV3IYXjC54+l7XNZ8eBcTvsIXDqO/wL9pX/ve6EWVINnkJ+7YVXwXN8m VCbnKENf6796a2kTt2RdakUXBx0K1Uq5AkEWrSkTgu1FN146nUGzfchJQDCEQxt4I2z6Ry3EiN1y1 bd28U3Yn+auoA6Q35M2E/h7MFctwkQjI/Ia0gDu/htTgT1dfJmJ27lie4gljzlkzmtg9YsUKvARm3 3uP5gGaw==; From: Richard Sent Date: Fri, 5 Apr 2024 21:05:53 -0400 Message-ID: <64c782009b2c286cc72513a4a7735bbad650052f.1712365552.git.richard@freakingpenguin.com> MIME-Version: 1.0 X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.226; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta226.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: , 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 Reported in . * guix/scripts/package.scm (process-query): search operating no longer passes empty strings to make-regexp to avoid unbounded memory usage. Change-Id: I8194591f0428c4f88fb101c0226b98f593a55709 --- Hi Guix! Not sure of the usefulness of small patches like this, but figure it gives me an excuse to trawl the repo and it's better to send it and not be needed than the inverse. I considered adding a --force flag to forcefully allow "" searches, but since multiple scripts use package.scm and there's a lot of CLI flags already it didn't seem appropriate to add another one, particularly if it just results in a system freeze. guix/scripts/package.scm | 2 ++ 1 file changed, 2 insertions(+) base-commit: 886ed061d7c57eb9d707b2af2c87402b86becf70 diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index a489e06e73..66e5384ddc 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -891,6 +891,8 @@ (define (process-query opts) (('search _) (let* ((patterns (filter-map (match-lambda + ;; https://issues.guix.gnu.org/70223 + (('query 'search "") #f) (('query 'search rx) rx) (_ #f)) opts))