From patchwork Sat Mar 18 16:57:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Antoine R. Dumont" X-Patchwork-Id: 48124 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 DD5E616F20; Sun, 19 Mar 2023 07:24:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7754816F0E for ; Sun, 19 Mar 2023 07:24:27 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdnOg-0005u3-IS; Sun, 19 Mar 2023 03:24:06 -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 1pdnOc-0005td-U6 for guix-patches@gnu.org; Sun, 19 Mar 2023 03:24:04 -0400 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 1pdnOc-0001ov-Kt for guix-patches@gnu.org; Sun, 19 Mar 2023 03:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdnOb-0007qW-V8 for guix-patches@gnu.org; Sun, 19 Mar 2023 03:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62264] [PATCH core-updates 1-6/6] Add `guix index` subcommand References: <87v8iy59j1.fsf@gmail.com> In-Reply-To: <87v8iy59j1.fsf@gmail.com> Resent-From: "Antoine R. Dumont" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 19 Mar 2023 07:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62264 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62264@debbugs.gnu.org Received: via spool by 62264-submit@debbugs.gnu.org id=B62264.167921059930110 (code B ref 62264); Sun, 19 Mar 2023 07:24:01 +0000 Received: (at 62264) by debbugs.gnu.org; 19 Mar 2023 07:23:19 +0000 Received: from localhost ([127.0.0.1]:49346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdnNr-0007pW-HG for submit@debbugs.gnu.org; Sun, 19 Mar 2023 03:23:19 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:33647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdZrq-00018d-UY for 62264@debbugs.gnu.org; Sat, 18 Mar 2023 12:57:21 -0400 Received: by mail-wr1-f53.google.com with SMTP id v16so6933989wrn.0 for <62264@debbugs.gnu.org>; Sat, 18 Mar 2023 09:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679158633; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=+MfSBmJumN+Gt5dgrP/tu2tQ85C211ITTdvats+OcBQ=; b=TEw/rJIhNFrFbJ0yFRqPRyfb+uXk+CSt4wm3I7OV2z29BNSU/hhBQgQ4rFmmVK1KTN tq9XneEylHsFVMImQSI4Kx+N46+jav2tSkCPU+r/7Q4S2mRNW2+ci6LEdi23WjqNtXgD 2T2hVcgagVkE6yFmQt0oeCjW3gd17yDgXklXBdzglepkvcd/in4p9RG2kc0qM72Q/zob bTq28SFYdWGG0yWLvc6SAoujZ3jrCnPtKk1cJHaeJqA35IuAR0+G9DOulgNhs+IBttAC ESt9WVWILrvOWFlBQoq5s4KVjiEg94Lzz2ZswCzNyNyozBTzNQeY6Qkkoy0vcIBYKK/0 YffA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679158633; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=+MfSBmJumN+Gt5dgrP/tu2tQ85C211ITTdvats+OcBQ=; b=szDtybyKuivrIDV1s8kShayFrpREaJJiPBpb0qN2Y7fU3mG1jysJ0kzOjttdgnkOGi mUoN5oJ3zvbL7F690z92RGkECIIXl2xKPixSTHxjzF6wlciG8R59gNm1+rhCA6uo6Abb 0AsCv5pxS84Vo0EyMKxPiKhSpVg6lI1Qnfz+qZoVF0wG00/3TVzLA1WQmoPDoHE5CYKw mKdu6NSZX/XqaSPsU0sR1UC1Ucptwb4IEnUBXape8PmZnAJ7lbUjGDI7zMkyFZ9kjTw3 A5poVu5McJ+nIvFvNE7PSQneWfjSOeZ5A7x9q5PjyMeyhv4MOmIvrfhqj9+YUKxduYjd 8dQg== X-Gm-Message-State: AO0yUKVxIv3vslCHBf8xM8uLBNffWbVLEnexoR1a1l1Ar23ZmxlAs7NF V24+IH7cxe56kX9R3Qx8x9mdfxfh190= X-Google-Smtp-Source: AK7set8/gTMWx36DlBf/SVjc+pyXbthjRzGhdQA4o4D1ObBlLMhP0eYjRjEt6C3cagM4ILtSm+gQxg== X-Received: by 2002:a5d:410e:0:b0:2cf:ee28:5024 with SMTP id l14-20020a5d410e000000b002cfee285024mr9345465wrp.42.1679158632582; Sat, 18 Mar 2023 09:57:12 -0700 (PDT) Received: from yavin4 ([2a01:e0a:1c8:8a40:52d2:ac70:415c:2470]) by smtp.gmail.com with ESMTPSA id n17-20020adff091000000b002c5534db60bsm4741129wro.71.2023.03.18.09.57.11 for <62264@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 09:57:11 -0700 (PDT) From: "Antoine R. Dumont" Date: Sat, 18 Mar 2023 17:57:10 +0100 Message-ID: <87r0tm576h.fsf@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 19 Mar 2023 03:23:14 -0400 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello again, please find enclosed the remaining patches holding the actual guix subcommand as described in the introductory email. Cheers, --- tony / Antoine R. Dumont (@ardumont) ----------------------------------------------------------------- gpg fingerprint BF00 203D 741A C9D5 46A8 BE07 52E2 E984 0D10 C3B8 From 372b2b9660b8293eebd6280bb46a4ec07d4192a7 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" Date: Mon, 13 Mar 2023 13:52:38 +0100 Subject: [PATCH core-updates 6/6] Allow gcroot function to exceptionally ignore error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored with Ludovic Courtès --- guix/store/roots.scm | 10 +++++++++- tests/store-roots.scm | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/guix/store/roots.scm b/guix/store/roots.scm index 222f69c5c0..c2b15c33f0 100644 --- a/guix/store/roots.scm +++ b/guix/store/roots.scm @@ -105,7 +105,15 @@ (define canonical-root (map (match-lambda ((file . properties) (cons (scope file) properties))) - (scandir* directory regular?))))) + (catch 'system-error + (lambda () + (scandir* directory regular?)) + (lambda args + (if (= ENOENT + (system-error-errno + args)) + '() + (apply throw args)))))))) (loop (append rest (map first sub-directories)) (append (map canonical-root (filter symlink? files)) roots) diff --git a/tests/store-roots.scm b/tests/store-roots.scm index 5bcf1bc87e..00a4fe7931 100644 --- a/tests/store-roots.scm +++ b/tests/store-roots.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2019 Ludovic Courtès +;;; Copyright © 2019, 2023 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +21,7 @@ (define-module (test-store-deduplication) #:use-module (guix store) #:use-module (guix store roots) #:use-module ((guix utils) #:select (call-with-temporary-directory)) + #:use-module ((guix config) #:select (%state-directory)) #:use-module (srfi srfi-1) #:use-module (srfi srfi-64)) @@ -29,6 +30,10 @@ (define %store (test-begin "store-roots") +(test-equal "gc-roots, initial" + (list (string-append %state-directory "/profiles")) + (gc-roots)) + (test-assert "gc-roots, regular root" (let* ((item (add-text-to-store %store "something" (random-text))) -- 2.36.1