From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id GJBpG6tubGYS4wAA62LTzQ:P1 (envelope-from ) for ; Fri, 14 Jun 2024 16:24:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GJBpG6tubGYS4wAA62LTzQ (envelope-from ) for ; Fri, 14 Jun 2024 18:24:11 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=JGbdsJci; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=inria.fr ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718382251; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=lUIOTfKfY6DjrKyKKP8w3oJIoyN9u8Bs7zhdcaPPd6Y=; b=aFJYo1fiOz1KXWeqy38y77ylcrcoU5VzDHrEPp+1khlpBRE7Ff4Dh3883jgUBF4XUvUSuN 71qvVoEbCsrANbBQwPjAoHnASMDbooJbtka/WLO902YWN3SNMbpQHMy4XJ3tznX1GE5LIB vyrVnb4zYT3WAJAMJ6jJTDOe46qtVkrdX2/Qaq/Xx4rw/+NyEnL3houfCkwMlpIIImSgIJ 10AtDHsUZdeUW8+YVIZKpKKcNVkrmxjtFBxEcI5huKTQsYWbgef+0hor3a8LcASwec3pKr DYCH+YcQNAUiR5k7dBvPa3K+hbzM5nis4H76P9sEeMoSJax7hqGVP1T4uVZajQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=inria.fr header.s=dc header.b=JGbdsJci; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=inria.fr ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718382251; a=rsa-sha256; cv=none; b=jNBmxkpAq1o7NSPB2vAr6I3ibPLj3Wl7Oa2bMK4dT1fvo/J9W19DJi9jr8itZUtldspzDS xJBuxCHHos6wYobtW5cfUgnoXCV2uJsAtozDCjvxENMtJ9hl+jDAb3c/baLkY8neiPv/AB 2/qXonowVA6ofDcoO7yqe2YCaq+6ROynPkJne9jpyW4IuvIuSuFZNFSPP1zqdqggllg6MK cNL8H31SY+L32Rma+/2bbjgiO1tMuWrFNfO3bNnP/vTNex3BmHuKUU1lbdZoFzSbTnf1jv 1yXQQgbtMYOfjiku5BH04K6RRL8xnW+aZLlytPxjAruEJ8MkYadqRFdloLNgAg== 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 553C110A5B for ; Fri, 14 Jun 2024 18:24:11 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sI9hS-00018H-Mq; Fri, 14 Jun 2024 12:22:50 -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 1sHiEk-0002tH-FF for guix-devel@gnu.org; Thu, 13 Jun 2024 07:03:22 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sHiEi-0007Ul-6Y for guix-devel@gnu.org; Thu, 13 Jun 2024 07:03:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=lUIOTfKfY6DjrKyKKP8w3oJIoyN9u8Bs7zhdcaPPd6Y=; b=JGbdsJcipfqE5oYnX2goR5Aub+Oz0V53JhqTQ66++ywkRC7lx4ZHC+nw 7oOBASsXy7UD8Jvc3cyx9S/jMmyHrmTWUsx9eSqg42nO/nwAYg8QrI8ZT U6uSsuzgXu32AT0UsmQEW7/FVUcdd0g8Q3RNybsmfO1KYlJGE1a1objVF k=; X-IronPort-AV: E=Sophos;i="6.08,234,1712613600"; d="scan'208";a="89586972" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.191]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2024 13:03:18 +0200 From: Romain GARBAGE To: guix-devel@gnu.org Cc: ludovic.courtes@inria.fr, Romain GARBAGE Subject: [PATCH Cuirass 1/4] specification: Ensure name is a symbol. Date: Thu, 13 Jun 2024 13:03:06 +0200 Message-ID: <20240613110311.12126-1-romain.garbage@inria.fr> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=192.134.164.104; envelope-from=romain.garbage@inria.fr; helo=mail3-relais-sop.national.inria.fr 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 14 Jun 2024 12:22:48 -0400 X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.36 X-Spam-Score: -9.36 X-Migadu-Queue-Id: 553C110A5B X-Migadu-Scanner: mx13.migadu.com X-TUID: 1qBZT0HUsz3b * src/cuirass/specification.scm (ensure-symbol): New variable. (specification)[name]: Ensure name is a symbol. * tests/database.scm: Fix test. --- src/cuirass/specification.scm | 11 ++++++++++- tests/database.scm | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cuirass/specification.scm b/src/cuirass/specification.scm index d62037e..7b237e6 100644 --- a/src/cuirass/specification.scm +++ b/src/cuirass/specification.scm @@ -138,10 +138,19 @@ packages manifests)) +(define (ensure-symbol x) + (if (string? x) + (string->symbol x) + x)) + (define-record-type* specification make-specification specification? - (name specification-name) ;symbol + (name specification-name + ;; There was a confusion in the documentation regarding + ;; the type of this field. For this reason, strings are + ;; accepted but silently converted into symbols. + (sanitize ensure-symbol)) ;symbol (build specification-build ;symbol for %build-types (default 'all)) (channels specification-channels ;list of diff --git a/tests/database.scm b/tests/database.scm index c4efb0a..010c139 100644 --- a/tests/database.scm +++ b/tests/database.scm @@ -190,7 +190,7 @@ timestamp, checkouttime, evaltime) VALUES ('guix', 0, 0, 0, 0);") (let* ((spec (db-get-specification "guix")) (channels (specification-channels spec)) (build-outputs (specification-build-outputs spec))) - (and (string=? (specification-name spec) "guix") + (and (eq? (specification-name spec) 'guix) (equal? (map channel-name channels) '(guix my-channel)) (equal? (map build-output-job build-outputs) '("job")))))) -- 2.45.1