From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 09 13:40:59 2023 Received: (at submit) by debbugs.gnu.org; 9 Aug 2023 17:40:59 +0000 Received: from localhost ([127.0.0.1]:40450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTnB5-0006hr-HE for submit@debbugs.gnu.org; Wed, 09 Aug 2023 13:40:59 -0400 Received: from lists.gnu.org ([2001:470:142::17]:46762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTnB3-0006he-Kn for submit@debbugs.gnu.org; Wed, 09 Aug 2023 13:40:58 -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 1qTnAx-0007SE-BY for bug-guix@gnu.org; Wed, 09 Aug 2023 13:40:51 -0400 Received: from tobias.gr ([80.241.217.52]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTnAv-0003wL-Jl for bug-guix@gnu.org; Wed, 09 Aug 2023 13:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=mjutwrdM2cQcf jKba9+MPZGx9DSsuxZIlhRsALPRYkI=; h=subject:to:from:date; d=tobias.gr; b=mvckA6vIzLQHNptZ6UTKKgLHB44/CfSeX2TPsNtS0L5YlRKu3gFTeNinrkAm/yzKbO2a 6kJfz3MOnbtNVUs5SujIn94ZcZtC30soMyZ2KiKVSRkTkpuQnLuob0NFqMRKNqMnuY1a/i XcTnH8tb9oEDFYyIfM60yj7IUCX9zNuqMATiSbSjP7Sa5soVDRVttK/+J46YqFOysQmiBj Af/ByijntZBFMPrbxbnGQBYt86zpEe95qtoFMbmdBnPlhn+U+23kNRA52gw/zZXtM9cJEG 9Gk30S1q5Be5qKmZtSwP/WGaKLq+xb86eO+QYFwe7pWmMhdYmSBAZeEYbz2XRkxQ== Received: by submission.tobias.gr (OpenSMTPD) with ESMTP id a8961a58 for ; Wed, 9 Aug 2023 17:40:42 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 09 Aug 2023 19:40:42 +0200 From: Tobias Geerinckx-Rice To: bug-guix@gnu.org Subject: =?UTF-8?Q?=28modify-services_=E2=80=A6_=28delete_=E2=80=A6=29=29?= =?UTF-8?Q?_should_delete_all_matching_service_types?= Message-ID: <786c3ff6d991719575b26a82cb7a39cb@tobias.gr> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=80.241.217.52; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.6 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) TODO: the snippet (modify-services %base-services (delete mingetty-service-type)) deletes only the first (tty1) instance of the mingetty service. I can't think of a scenario where this is likely to reflect the user's intention. It should delete all matching services. A delete-first variant could be added iff there's demand. Kind regards, T G-R Sent from a Web browser. Excuse or enjoy my brevity. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 09 13:49:10 2023 Received: (at control) by debbugs.gnu.org; 9 Aug 2023 17:49:10 +0000 Received: from localhost ([127.0.0.1]:40465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTnJ0-00019Z-5F for submit@debbugs.gnu.org; Wed, 09 Aug 2023 13:49:10 -0400 Received: from tobias.gr ([80.241.217.52]:56850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qTnIx-00019Q-Le for control@debbugs.gnu.org; Wed, 09 Aug 2023 13:49:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=8Qolz8ZZc7nJk 7Q86zvng7ZWXs49zsv6aaJ/ncalzXY=; h=to:from:date; d=tobias.gr; b=ftQPkt 9bSGXtY2ndbQSsQabGKiB6WpxOTyulREM8jAlZFXkMA2rqv66HwDehekfP5mjER832UPUz 0ip7j8rN9dV/NOd5DFrLx9k1jwvNUth6xPZubL5MxihflkHoRI3iJuK4GvYjES3e8poEA4 yUgjfpcafFlCT/JmKF0i441i1RHcpzu1c8Q8KIpsLKl8GwVBLw5VkHQrDNI0fRGjNtXc10 P70/quBwhR4Xww0D7nFYRRzWkzGrrSdasHIa87cfMXA7awgjUkoc1B/BDaX7a4BR5l9aQ1 jiGmeiCJZwLjGXdndaHWN6rckWk1ydrdCAaGvDb3ae1ztVE8zb+tVRjw== Received: by submission.tobias.gr (OpenSMTPD) with ESMTP id 64d7ef51 for ; Wed, 9 Aug 2023 17:49:04 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 09 Aug 2023 19:49:04 +0200 From: Tobias Geerinckx-Rice To: control@debbugs.gnu.org Message-ID: <7381c9980c40714ebb8255e7ac7f0931@tobias.gr> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: severity 65184 important merge 64106 65184 thanks sigh Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) severity 65184 important merge 64106 65184 thanks sigh From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 23:50:11 2023 Received: (at 65184-done) by debbugs.gnu.org; 1 Sep 2023 03:50:12 +0000 Received: from localhost ([127.0.0.1]:59594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbvAh-0007ui-0b for submit@debbugs.gnu.org; Thu, 31 Aug 2023 23:50:11 -0400 Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]:46425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbvAe-0007uR-TX; Thu, 31 Aug 2023 23:50:09 -0400 Received: by mail-qv1-xf2d.google.com with SMTP id 6a1803df08f44-64f3ad95ec0so8903426d6.1; Thu, 31 Aug 2023 20:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693540194; x=1694144994; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=eGy18eGgRKfNdbnU+Sv5c5Wvy3ZDwF1aF2rz5wTXkC0=; b=fwnp04B0vDItz1kJjt3gZfXLuiVjfrbG31b0I3KO7gQ+t2K0wg7ou/pvmpOIZPkv+H /9jMDIzu3pBbgeMNjdT8yseln/WZJXNzcJ9wH/JizeBo7U7h/RPwJeKWilOgrRNEdudl JIOYerIqoQ5TbwkQQt2pCgNlMsFYad5tIe7JldqcOa43DUfq0cZffjfgRMikwzTUfFua cV0hFuzBRSBcdMQuZVWuNelqdIRLxmxMkfw33AIjbna8a8WULUjmKzFmAfXq50xmIOkI z29deDLY5+sXH8HW6vI4adfMXM2b3v27NFUy6qawlm9J5kQP+vDNswLW5v6/th2xW6Y/ j+VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693540194; x=1694144994; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=eGy18eGgRKfNdbnU+Sv5c5Wvy3ZDwF1aF2rz5wTXkC0=; b=Y+QyCKSJlNf4JQSzOkewi5jRf7sn4G7aJ582YLHCyOnppaGQoQBhcJG+u1w6WMnwdp NXcmv8Lx7FLEmVZqM36QKGmC2AMxI6JzAzkzFQ85JnkLK7eM8JPZS9rcv+wGgbe7DKfu KOFu1FV8+BACqQtYTQ0UNvWnQbkPXwF3DvwKwl3ZUP6KuqIr+DFKgfP9YD88Q9tEZxhu U6D7XnQrIcMPC1WH4jvG2AdXPo/MUULObzDZ5L7EyR2GOHIxAG+U6kTijywBj2s8BfLl JHevPXgO0dcaeATptZlIEdVyUr3OgzIPp1VpcVxc+PoCl1QJEwE8KAtqTxfow1z3/0Rz Nrjw== X-Gm-Message-State: AOJu0Yw33QBKVoeJHeE+Vtb1Asbz969PiADsi+R+xjtanHDj0QRtnuRh t9DDTXjv2iCXlaXtkUJfHhCxSLmnim3RJQ== X-Google-Smtp-Source: AGHT+IFNQbPNUCAyOIRToryhPig0r6vVIdHjU5/CBQLOdmdShAP7XLHpuzVvJ+X0hA/QLiKIdbPlng== X-Received: by 2002:a0c:e009:0:b0:64d:f3c7:50aa with SMTP id j9-20020a0ce009000000b0064df3c750aamr1026424qvk.22.1693540194362; Thu, 31 Aug 2023 20:49:54 -0700 (PDT) Received: from hurd (dsl-10-128-23.b2b2c.ca. [72.10.128.23]) by smtp.gmail.com with ESMTPSA id j9-20020a0ce009000000b0064aa51f9978sm1115512qvk.115.2023.08.31.20.49.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Aug 2023 20:49:53 -0700 (PDT) From: Maxim Cournoyer To: Brian Cully Subject: Re: bug#65184: (modify-services =?utf-8?Q?=E2=80=A6?= (delete =?utf-8?Q?=E2=80=A6=29=29?= should delete all matching service types References: Date: Thu, 31 Aug 2023 23:49:52 -0400 In-Reply-To: (Brian Cully's message of "Mon, 17 Jul 2023 13:02:19 -0400") Message-ID: <87msy65z8f.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65184-done Cc: ludo@gnu.org, me@tobias.gr, david@daviwil.com, felix.lechner@lease-up.com, 65184-done@debbugs.gnu.org, 64106-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Brian! Brian Cully writes: > This patch reverts the behavior introduced in > 181951207339508789b28ba7cb914f983319920f which caused =E2=80=98modify-ser= vices=E2=80=99 > clauses to only match a single instance of a service. > > We will now match all service instances when doing a deletion or update, = while > still raising an exception when trying to match against a service that do= es > not exist in the services list, or which was deleted explicitly by a =E2= =80=98delete=E2=80=99 > clause (or an update clause that returns =E2=80=98#f=E2=80=99 for the ser= vice). > > Fixes: #64106 > > * gnu/services.scm (%modify-services): New procedure. > (modify-services): Use it. > (apply-clauses): Add DELETED-SERVICES argument, change to modify one serv= ice > at a time. > * tests/services.scm > ("modify-services: delete then modify"), > ("modify-services: modify then delete"), > ("modify-services: delete multiple services of the same type"), > ("modify-services: modify multiple services of the same type"): New tests. [...] I've applied the following cosmetic changes: --8<---------------cut here---------------start------------->8--- 1 file changed, 20 insertions(+), 18 deletions(-) gnu/services.scm | 38 ++++++++++++++++++++------------------ modified gnu/services.scm @@ -325,11 +325,13 @@ (define-syntax clause-alist '()))) =20 (define (apply-clauses clauses service deleted-services) + "Apply CLAUSES, an alist as returned by 'clause-alist', to SERVICE. An +exception is raised if a clause attempts to modify a service +present in DELETED-SERVICES." (define (raise-if-deleted kind properties) - (match (find (lambda (deleted) - (match deleted - ((deleted-kind _) - (eq? kind deleted-kind)))) + (match (find (match-lambda + ((deleted-kind _) + (eq? kind deleted-kind))) deleted-services) ((_ deleted-properties) (raise (make-compound-condition @@ -344,27 +346,27 @@ (define (apply-clauses clauses service deleted-servic= es) =20 (match clauses (((kind proc properties) . rest) - (begin - (raise-if-deleted kind properties) - (if (eq? (and service (service-kind service)) - kind) - (let ((new-service (proc service))) - (apply-clauses rest new-service - (if new-service - deleted-services - (cons (list kind properties) - deleted-services)))) - (apply-clauses rest service deleted-services)))) + (raise-if-deleted kind properties) + (if (eq? (and service (service-kind service)) kind) + (let ((new-service (proc service))) + (apply-clauses rest new-service + (if new-service + deleted-services + (cons (list kind properties) + deleted-services)))) + (apply-clauses rest service deleted-services))) (() service))) =20 (define (%modify-services services clauses) + "Apply CLAUSES, an alist as returned by 'clause-alist', to SERVICES. An +exception is raised if a clause attempts to modify a missing service." (define (raise-if-not-found clause) (match clause ((kind _ properties) - (when (not (find (lambda (service) - (eq? kind (service-kind service))) - services)) + (unless (find (lambda (service) + (eq? kind (service-kind service))) + services) (raise (make-compound-condition (condition (&error-location --8<---------------cut here---------------end--------------->8--- and installed it. Thanks for contributing to Guix! --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 00:01:02 2023 Received: (at 65184) by debbugs.gnu.org; 1 Sep 2023 04:01:02 +0000 Received: from localhost ([127.0.0.1]:59611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbvLC-0008Cu-6A for submit@debbugs.gnu.org; Fri, 01 Sep 2023 00:01:02 -0400 Received: from sail-ipv4.us-core.com ([208.82.101.137]:37404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbvL9-0008CL-HN; Fri, 01 Sep 2023 00:01:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=SG6JJ/BhME9Tm9I 6AYFptapp6tIG06J1Eo6rQHeLrwQ=; h=cc:to:subject:date:from:in-reply-to: references; d=lease-up.com; b=IGsw0+JWowOcRAivlEL8kcwSyZnVuTsq/7M1BSBM d6kUUUI/87Ik3AKbj06T3Sw51WD4Ihd1+vu+vbHtTiEHqb1Tt9uwhkJ8YOkSWmxzfI/asj JzcvAENxoZm9ZqK4W2hBqpRHWDZbCrUoTy9RZGwyGjJuoLE8/XIs7O7zGb5Bw= Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 5b582eb1 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Fri, 1 Sep 2023 04:00:48 +0000 (UTC) Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-500b6456c7eso2879834e87.2; Thu, 31 Aug 2023 21:00:47 -0700 (PDT) X-Gm-Message-State: AOJu0YzqRFNfwMPgXVSh+LVAFqjoh0cQ0wmjjEignU+zWleYSOuK1Hyi ++eEaqGEy9acDWYbQhEk7vJZ+IYJMCPaTt2e+yc= X-Google-Smtp-Source: AGHT+IFx3NuXjXUFVAToPxAm63YncSkvbeI/1St4FtErLW9FChpErEtDHFZBTgHMS5IaEWfKpuPjaUhzNjfJt20ZXTc= X-Received: by 2002:a05:6512:4017:b0:4fd:fecf:5d57 with SMTP id br23-20020a056512401700b004fdfecf5d57mr803833lfb.39.1693540845946; Thu, 31 Aug 2023 21:00:45 -0700 (PDT) MIME-Version: 1.0 References: <87msy65z8f.fsf_-_@gmail.com> In-Reply-To: <87msy65z8f.fsf_-_@gmail.com> From: Felix Lechner Date: Thu, 31 Aug 2023 21:00:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: =?UTF-8?Q?Re=3A_bug=2365184=3A_=28modify=2Dservices_=E2=80=A6_=28delete_=E2=80=A6=29=29_sh?= =?UTF-8?Q?ould_delete_all_matching_service_types?= To: Maxim Cournoyer Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65184 Cc: Josselin Poiret , Brian Cully , ludo@gnu.org, me@tobias.gr, "pelzflorian \(Florian Pelz\)" , 65184@debbugs.gnu.org, Jelle Licht , david@daviwil.com, 64106@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Maxim, On Thu, Aug 31, 2023 at 8:49=E2=80=AFPM Maxim Cournoyer wrote: > > > Fixes: #64106 Thanks for taking action. Can Bug#63921 also be closed? Kind regards Felix From unknown Sun Jun 22 03:58:43 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 29 Sep 2023 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator