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 SAZzFisp1GJImgAAbAwnHQ (envelope-from ) for ; Sun, 17 Jul 2022 17:22:19 +0200 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 oB41Fisp1GIUvQAA9RJhRA (envelope-from ) for ; Sun, 17 Jul 2022 17:22:19 +0200 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 2710C40757 for ; Sun, 17 Jul 2022 17:22:19 +0200 (CEST) Received: from localhost ([::1]:53744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oD666-0006aS-DA for larch@yhetil.org; Sun, 17 Jul 2022 11:22:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD65r-0006Oa-4U for guix-patches@gnu.org; Sun, 17 Jul 2022 11:22:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD65q-0002SJ-G1 for guix-patches@gnu.org; Sun, 17 Jul 2022 11:22:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oD65q-0004XK-8B for guix-patches@gnu.org; Sun, 17 Jul 2022 11:22:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56618] [PATCH 2/2] guix gc: '--delete-generations' now deletes old Home generations. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Jul 2022 15:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56618 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56618@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 56618-submit@debbugs.gnu.org id=B56618.165807129317384 (code B ref 56618); Sun, 17 Jul 2022 15:22:02 +0000 Received: (at 56618) by debbugs.gnu.org; 17 Jul 2022 15:21:33 +0000 Received: from localhost ([127.0.0.1]:48337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD65M-0004WK-Ms for submit@debbugs.gnu.org; Sun, 17 Jul 2022 11:21:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD65K-0004W4-QU for 56618@debbugs.gnu.org; Sun, 17 Jul 2022 11:21:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47292) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD65F-0002P5-Jd; Sun, 17 Jul 2022 11:21:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=FKXg55syY+dGk68D1vMQxNPKYLd2UzoHPOuAWPxTXWM=; b=XMphXe70JgDA25KNfG18 A7uIxV2xkQbsDQdh3b6KoszJi0ZSf5c3oevp+Jj+o/KhnPvbW5jsy+2a96kL2qCjDDpLBf9cM+wKd yYCA9I8JlEoV6+zr9NqSRT8ps628OTK+0F1NQcBUGoN+UdKgJvMb60OR19sC4GlbomWAGkn5Ks3a+ L7IIINtCbU73NLVTnIA7/p0XS3rNZJZo43Z89VXd/bxAFvAW2L2B+7E+nfN4ajfohRe8QqdIcszFQ psSyn8T5vdwmo1ne4OqhsGkkOYlF+thpD4jy4UAyVGQ+2R3KWcyqGs64d48B721XJ2+z8lcug9eTy BGvR/JO7BEio5g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56420 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD65F-0001jK-7A; Sun, 17 Jul 2022 11:21:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sun, 17 Jul 2022 17:21:17 +0200 Message-Id: <20220717152117.23452-2-ludo@gnu.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220717152117.23452-1-ludo@gnu.org> References: <20220717152117.23452-1-ludo@gnu.org> MIME-Version: 1.0 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658071339; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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:dkim-signature; bh=FKXg55syY+dGk68D1vMQxNPKYLd2UzoHPOuAWPxTXWM=; b=EPACYQ3CZ+JhdZ24TUkVV0f/uKk8cIkPnpr92aRUsc9E4W8VHX53TYxT7r7oNojS1BlD+u Db2U9WX/m3I0t1k0ShxJf1Iw+giTjTxTnUTfefJi6on2ZebCWv4DwZQ8eRyZAu2kuAsxcv XE1gbDwJvXkW7RrDuD/D4H9DQyt7o76upFS9Qyk51X8ikDFShL3WLDEBpKczQWvg3JebL3 9RUJBCfxXRQgHP7gn29NjWpCxmmfd/+3MqmnkgeBmS3AzqsmVVPWia3R7Rki9Fwm8c2QL7 FEKf05D0TzQrQ+wRWYZquVymlPwbpENntvoMmu9Bxz/u9Go4jqT6b+JMbAYRIw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658071339; a=rsa-sha256; cv=none; b=BGoXJpZYj+nSgDwsYkg0otKx1JynCg6tJMwmR1Sd7C9I8URDjSmBQdEFzW6f3zirVH8ugQ LYVL5zQXL18+I9y2tSKCyyhm7jDcu7O1cRnzo02WkNCUeXk1efE5UOSnyoKk6i96pYQTAV H6IGbwPOuDVGFHvmr2AnGI0QBk+erM0uwK6Wsmkqu5MHWUICD9dcg4cUgieV4yo7tvs5ts Db0hzhWHjE0Wy8IUxK+QLMgNjyO8rcptWm26WfRlK29axL+cXiqlnbeeghpGIZ9HVmx05b iQN4hbc9DRPYVek5/BvYB3uRVUZXeJhRgukmtt6bL4Y0rcYc9We1hd8fK0NqRg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=XMphXe70; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -1.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=XMphXe70; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: 2710C40757 X-Spam-Score: -1.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: JX+KMWZ8JVdq Previously, 'guix gc -d4m' would ignore Home generations. With this change, they are treated like profiles and generations that match the pattern are deleted. * guix/scripts/gc.scm (guix-gc)[delete-generations]: Add call to 'home-generation-base'. * doc/guix.texi (Invoking guix gc): Document the change. --- doc/guix.texi | 3 ++- guix/scripts/gc.scm | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 8fc8f53d0e..f3f3189f64 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4362,7 +4362,8 @@ nothing and exit immediately. @item --delete-generations[=@var{duration}] @itemx -d [@var{duration}] Before starting the garbage collection process, delete all the generations -older than @var{duration}, for all the user profiles; when run as root, this +older than @var{duration}, for all the user profiles and home environment +generations; when run as root, this applies to all the profiles @emph{of all the users}. For example, this command deletes all the generations of all your profiles diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm index 043273f491..65cd4bdf8b 100644 --- a/guix/scripts/gc.scm +++ b/guix/scripts/gc.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +;;; Copyright © 2012-2013, 2015-2020, 2022 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -26,6 +26,7 @@ (define-module (guix scripts gc) profile-generations generation-number) #:autoload (guix scripts package) (delete-generations) + #:autoload (gnu home) (home-generation-base) #:use-module (ice-9 match) #:use-module (ice-9 regex) #:use-module (srfi srfi-1) @@ -260,7 +261,8 @@ (define (delete-generations store pattern) (filter-map (lambda (root) (and (or (zero? (getuid)) (user-owned? root)) - (generation-profile root))) + (or (generation-profile root) + (home-generation-base root)))) (gc-roots))))) (for-each (lambda (profile) (delete-old-generations store profile pattern)) -- 2.36.1