From patchwork Tue Feb 23 13:30:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 27208 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 3F70F27BC49; Tue, 23 Feb 2021 13:31:20 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0E8CA27BC48 for ; Tue, 23 Feb 2021 13:31:20 +0000 (GMT) Received: from localhost ([::1]:51864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEXmZ-0004E4-2F for patchwork@mira.cbaines.net; Tue, 23 Feb 2021 08:31:19 -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 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" X-getmail-retrieved-from-mailbox: Patches Hey, > I guess the first step would be to provide an a ‘package-channel(s)’ > procedure that does like ‘package-provenance’, but returns 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 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