From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CAtbGaoDNWCISgAA0tVLHw (envelope-from ) for ; Tue, 23 Feb 2021 13:31:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0KamFKoDNWDwNwAAB5/wlQ (envelope-from ) for ; Tue, 23 Feb 2021 13:31:22 +0000 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 366AB10E04 for ; Tue, 23 Feb 2021 14:31:21 +0100 (CET) Received: from localhost ([::1]:51864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEXmZ-0004E4-Vs for larch@yhetil.org; Tue, 23 Feb 2021 08:31:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEXmL-0004Dx-OG for guix-patches@gnu.org; Tue, 23 Feb 2021 08:31:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lEXmH-0001gE-Te for guix-patches@gnu.org; Tue, 23 Feb 2021 08:31:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lEXmH-0003aF-Pn for guix-patches@gnu.org; Tue, 23 Feb 2021 08:31:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#46031] services: cuirass: Add "simple-cuirass-services". Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Feb 2021 13:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46031 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 46031@debbugs.gnu.org, Jonathan Brielmaier Received: via spool by 46031-submit@debbugs.gnu.org id=B46031.161408701713725 (code B ref 46031); Tue, 23 Feb 2021 13:31:01 +0000 Received: (at 46031) by debbugs.gnu.org; 23 Feb 2021 13:30:17 +0000 Received: from localhost ([127.0.0.1]:58540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEXlZ-0003ZH-4u for submit@debbugs.gnu.org; Tue, 23 Feb 2021 08:30:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lEXlX-0003Z0-5Q for 46031@debbugs.gnu.org; Tue, 23 Feb 2021 08:30:15 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45698) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEXlR-0001Jm-17; Tue, 23 Feb 2021 08:30:09 -0500 Received: from [2a01:e0a:19b:d9a0:d047:2c08:886f:ec31] (port=55952 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lEXlQ-0005NT-Gv; Tue, 23 Feb 2021 08:30:08 -0500 From: Mathieu Othacehe In-Reply-To: <87v9aj5dyl.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 23 Feb 2021 10:29:54 +0100") References: <87czxxz767.fsf@gnu.org> <874ki7j97p.fsf@gnu.org> <87k0r0iizg.fsf@gnu.org> <87eeh8b6mq.fsf@gnu.org> <87blcbkw52.fsf@gnu.org> <87v9aj5dyl.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Date: Tue, 23 Feb 2021 14:30:06 +0100 Message-ID: <875z2ilxnl.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.87 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 366AB10E04 X-Spam-Score: -2.87 X-Migadu-Scanner: scn0.migadu.com X-TUID: h4VALo+G7mV8 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hey, > I guess the first step would be to provide an a =E2=80=98package-channel(= s)=E2=80=99 > procedure that does like =E2=80=98package-provenance=E2=80=99, but return= s a list of > channels. Seems fine to me. Here's an implementation attached. If it works for you, the next step will be to make the "cuirass-jobs" procedure of "gnu-system.scm" operate on channels I guess. WDYT? Thanks, Mathieu --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-describe-Add-package-channels.patch >From d44dcd5d153ba0a4627c205f24a0741384f3d301 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Tue, 23 Feb 2021 14:24:39 +0100 Subject: [PATCH] describe: Add package-channels. * guix/describe.scm (package-channels): New procedure. --- guix/describe.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/guix/describe.scm b/guix/describe.scm index 03569b1db4..65e5772856 100644 --- a/guix/describe.scm +++ b/guix/describe.scm @@ -33,6 +33,7 @@ package-path-entries package-provenance + package-channels manifest-entry-with-provenance manifest-entry-provenance)) @@ -178,6 +179,26 @@ property of manifest entries, or #f if it could not be determined." `(,main ,@(if extra (list extra) '())))))))))) +(define (package-channels package) + "Return the list of channels providing PACKAGE or an empty list if it could +not be determined." + (match (and=> (package-location package) location-file) + (#f #f) + (file + (let ((file (if (string-prefix? "/" file) + file + (search-path %load-path file)))) + (and file + (string-prefix? (%store-prefix) file) + + (filter-map + (lambda (entry) + (let ((item (manifest-entry-item entry))) + (and (or (string-prefix? item file) + (string=? "guix" (manifest-entry-name entry))) + (manifest-entry-channel entry)))) + (current-profile-entries))))))) + (define (manifest-entry-with-provenance entry) "Return ENTRY with an additional 'provenance' property if it's not already there." -- 2.30.1 --=-=-=--