GNU bug report logs - #51427
[PATCH] nix: libstore: Do not remove unused links when deleting specific items.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Wed, 27 Oct 2021 03:50:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51427 <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler <at> gmail.com>, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [bug#51427] [PATCH] nix: libstore: Do not remove unused links when deleting specific items.
Date: Wed, 17 Nov 2021 12:49:09 +0100
Hi Ludo,

On Wed, 17 Nov 2021 at 11:02, Ludovic Courtès <ludo <at> gnu.org> wrote:
> zimoun <zimon.toutoune <at> gmail.com> skribis:
>
>> I have not checked the code, maybe I should start by that. ;-) Is it not
>> possible to simply skip the deleting phase when the option ’-D’ is used?
>
> No; like I wrote, it would have the effect of not deleting anything:

After giving a look at the code, yeah it is not so simple. :-)


>   https://issues.guix.gnu.org/51427#1
>
> Needs more thought…

The logic is complicated, thus adding this guard…

--8<---------------cut here---------------start------------->8---
    if (options.maxFreed > 0) {      
      /* Clean up the links directory. */
      if (options.action == GCOptions::gcDeleteDead || options.action == GCOptions::gcDeleteSpecific) {
        printMsg(lvlError, format("deleting unused links..."));
        removeUnusedLinks(state);
      }      
    }
--8<---------------cut here---------------end--------------->8---

…is probably dumb.  From my understanding, it should bypass the phase
’removeUnusedLinks’ when using “guix gc -D”.  Well, I have not tested
it.


Cheers,
simon




This bug report was last modified 2 years and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.