bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23874: [PATCH 1/2] profiles: Remove duplicates in manifest transacti


From: Mark H Weaver
Subject: bug#23874: [PATCH 1/2] profiles: Remove duplicates in manifest transactions.
Date: Wed, 02 Dec 2020 15:26:15 -0500

Hi,

Leo Prikler <leo.prikler@student.tugraz.at> writes:

> * guix/profiles.scm (manifest-transaction-effects): Delete duplicates in
> install and remove.  Let multiple upgrades and downgrades shadow previous
> transactions of the same kind.
> ---
>  guix/profiles.scm | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/guix/profiles.scm b/guix/profiles.scm
> index 1b15257210..99b7dbf299 100644
> --- a/guix/profiles.scm
> +++ b/guix/profiles.scm
[...]
> @@ -740,10 +743,10 @@ replace it."
>           (loop rest
>                 (if previous install (cons entry install))
>                 (if (and previous newer?)
> -                   (alist-cons previous entry upgrade)
> +                   (assoc-set! upgrade previous entry)
>                     upgrade)
>                 (if (and previous (not newer?))
> -                   (alist-cons previous entry downgrade)
> +                   (assoc-set! downgrade previous entry)
>                     downgrade)))))))

We should avoid mutating existing list structure, as done above with
'assoc-set!'.

     Thanks,
       Mark





reply via email to

[Prev in Thread] Current Thread [Next in Thread]