guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] guix package: Add '--delete-generations'.


From: Ludovic Courtès
Subject: Re: [PATCH] guix package: Add '--delete-generations'.
Date: Sun, 22 Sep 2013 22:55:02 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Nikita Karetnikov <address@hidden> skribis:

> Can I push this patch to ‘master’?  Do you see any problems?

Looks good!  Minor issues discussed below.

> I had noticed that ‘--roll-back’ doesn’t output anything with
> ‘--dry-run’, so I implemented ‘--delete-generations’ similarly.  Maybe
> it would be better to print something.  WDYT?

Agreed (in a separate patch.)

> address@hidden address@hidden
> address@hidden -d address@hidden
> +Delete generations.

“Delete the generations matching @var{patterns} or ... when omitted.”

Or what actually?  I would expect it to delete all the generations but
the current one when PATTERN is omitted, right?

> +(define (link-to-empty-environment generation)
> +  "Link GENERATION, a string, to the empty environment."

s/environment/profile/ maybe?  (I know there are other inconsistencies
in these files.)

Ideally this factorization would go in a patch of its own, before the
one that adds --delete-generations.  Is that doable for you?

> +  (define (apply-to-generations function profile pattern)

s/function/proc/ to follow the convention.

> +        (cond ((zero? number))  ; do not delete generation 0
> +              ((and (current-generation? profile generation)
> +                    (not (file-exists? previous-generation)))
> +               (begin (link-to-empty-environment previous-generation)
> +                      (switch-to-previous-generation profile)
> +                      (display-and-delete generation)))
> +              ((current-generation? profile generation)
> +               (begin (roll-back profile)
> +                      (display-and-delete generation)))

No need for ‘begin’ in the body of a ‘cond’ clause.

>      ;; First roll back if asked to.
> -    (if (and (assoc-ref opts 'roll-back?) (not dry-run?))
> -        (begin
> -          (roll-back profile)
> -          (process-actions (alist-delete 'roll-back? opts)))
> -        (let* ((installed (manifest-packages (profile-manifest profile)))
> -               (upgrade-regexps (filter-map (match-lambda
> -                                             (('upgrade . regexp)
> -                                              (make-regexp (or regexp "")))
> -                                             (_ #f))

[...]

Why is there this big hunk?  If it’s just reindenting, could you arrange
to remove this hunk?

Thanks!

Ludo’.



reply via email to

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