From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id cEL/OdCml2NueQAAbAwnHQ (envelope-from ) for ; Mon, 12 Dec 2022 23:10:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0Nw2OtCml2PThQAA9RJhRA (envelope-from ) for ; Mon, 12 Dec 2022 23:10:24 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B639AAF49 for ; Mon, 12 Dec 2022 23:10:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4qzs-0004T8-7N; Mon, 12 Dec 2022 17:10:04 -0500 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 1p4qzq-0004Sy-KD for guix-patches@gnu.org; Mon, 12 Dec 2022 17:10:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4qzq-0001ke-Cb for guix-patches@gnu.org; Mon, 12 Dec 2022 17:10:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4qzq-0004mv-8H for guix-patches@gnu.org; Mon, 12 Dec 2022 17:10:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60014] [PATCH] activation: make install-special-file match against pairs as well. Resent-From: mirai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Dec 2022 22:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60014 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Josselin Poiret , 60014@debbugs.gnu.org Received: via spool by 60014-submit@debbugs.gnu.org id=B60014.167088299518392 (code B ref 60014); Mon, 12 Dec 2022 22:10:02 +0000 Received: (at 60014) by debbugs.gnu.org; 12 Dec 2022 22:09:55 +0000 Received: from localhost ([127.0.0.1]:55699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4qzj-0004ma-At for submit@debbugs.gnu.org; Mon, 12 Dec 2022 17:09:55 -0500 Received: from smtpmciv2.myservices.hosting ([185.26.107.238]:43330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4qzh-0004mU-Ak for 60014@debbugs.gnu.org; Mon, 12 Dec 2022 17:09:53 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv2.myservices.hosting (Postfix) with ESMTP id 075A920BFB; Mon, 12 Dec 2022 23:09:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id B3CC380097; Mon, 12 Dec 2022 23:09:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id g1Yocgsfr4KQ; Mon, 12 Dec 2022 23:09:50 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 47D5380096; Mon, 12 Dec 2022 23:09:50 +0100 (CET) Message-ID: <7f00edbf-8b39-0d3e-4d29-0815176d143c@makinata.eu> Date: Mon, 12 Dec 2022 22:09:49 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US References: <43e937e1625b47a80887e68847fb8a8811d3f39f.1670867103.git.mirai@makinata.eu> <87k02wfjk5.fsf@jpoiret.xyz> From: mirai In-Reply-To: <87k02wfjk5.fsf@jpoiret.xyz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670883020; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=e+ZPHGfdsTmXSLIAIcMp473KRz9stJc//LhJrWJl7Ws=; b=fFOJ51DDyTR4cs4znYdsGypG7/dt0UDFUQZsrnWgVETkQp5hIKVM0/9v8xrjIi4doffOGy lkVrvWzgT/bF9CAQUaz/tSw39CnPs2h29JEgY01+9UOSxbbgk2CQjPuCPlIp/VU5l9vrW+ vZaSEIlYArYKrZYbnnSqadgjRLme2cDjq62YermuAvR13539ztrx/+3ZkzZPdECvGXd6M2 hOModE2OYR1oqbo+bMZ4UIWdVw1Dlkh5W3j0uaOJ093D08A2tlF609+zhF+CbQpcmvIS2V 9XqNypTXmWBFVpiGj4t5Sp93Q5+sF2K+F1XImWHK1x0dBKwHdKCPy3ffzu5DxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670883020; a=rsa-sha256; cv=none; b=jxRrheW65WcQmdVzV7sDoj4nwWCYJyKI05eK4OG2y5j5nX+1jW2XpK+ecUKtBli4zJHwWQ h/zkww8akNHHZxj15to4jvFcVIxKm14rMhQt73E2JbwRI+9ckaiNbI0X+0FADUWKtEds4v dKg11Twmq6HXS1bINCsw/MW7PTnPIzGz6ObLoDVYH3kkMlj0JIByS0XyeheTmEOa129+/3 UKEoYBLPKsaizE7lCJXXxDcfLqERAoIWWUwV4BvaFK9AvLYmx0Ci1xmx/Bw2KMyKzMyYP8 v5uvPH62Pf3MdGk/seB2pz6X9SAKR+lIETpBWJ2PGfjA8YgLW4lQpNRNQaj72g== X-Migadu-Spam-Score: -2.96 X-Spam-Score: -2.96 X-Migadu-Queue-Id: B639AAF49 X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-TUID: WEnX+e2Kor7W On 2022-12-12 20:34, Josselin Poiret wrote: > Hi Bruno, > > Is this patch related to some specific problem you're running into? I > personally would prefer keeping the special file interface as-is, and > not mix two different kinds of entries: lists with 2 elements, and > pairs. That would avoid having to manage even more edge-cases down the > line if some more processing is needed. I'm writing a service definition that uses a special-files-service-type service-extension. The documentation for it says: --8<---------------cut here---------------start------------->8--- The value associated with special-files-service-type services must be a list of tuples where the first element is the “special file” and the second element is its target. --8<---------------cut here---------------end--------------->8--- I assume a pair is a reasonable interpretation of 'tuples' in this context, so I proceeded to serialize the fields with: --8<---------------cut here---------------start------------->8--- (cons "filename here" (mixed-text-file "filename" contents ...)) --8<---------------cut here---------------end--------------->8--- Which I think is the natural way of doing it. (and communicates the intent, a pair with a path and a file-like object.) Of course, (list "path" file-like-obj) works as well but imo the pair is clearer in purpose. (what meaning would the third element and so on have, if ever present?) This I found out the hard way by getting strange errors until I looked into what happens behind `special-files-service-type' and realizing that only lists were accepted. The mixing of cases is unfortunate (it should have been pairs from the start) but preserves compatibility with existing syntax.