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: Leo Prikler
Subject: bug#23874: [PATCH 1/2] profiles: Remove duplicates in manifest transactions.
Date: Wed, 02 Dec 2020 23:25:01 +0100
User-agent: Evolution 3.34.2

Hi Mark,

Am Mittwoch, den 02.12.2020, 15:26 -0500 schrieb Mark H Weaver:
> 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!'.
In this case the bug is not with mutating existing structures (as those
are allocated only for this loop), but in not checking, whether the
entries are the same.  Either way, I've now implemented a version, that
should fix both wrong-doings (see attachment).

Regards, Leo

Attachment: 0001-profiles-Remove-duplicates-in-manifest-transactions.patch
Description: Text Data


reply via email to

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