guix package: Sort the list of generation numbers in '--list-generations'.
* guix/scripts/package.scm (generation-numbers): Sort the result.
This commit is contained in:
parent
4d497632ce
commit
99882c613c
|
@ -97,7 +97,7 @@
|
||||||
"-([0-9]+)")))
|
"-([0-9]+)")))
|
||||||
|
|
||||||
(define (generation-numbers profile)
|
(define (generation-numbers profile)
|
||||||
"Return the list of generation numbers of PROFILE, or '(0) if no
|
"Return the sorted list of generation numbers of PROFILE, or '(0) if no
|
||||||
former profiles were found."
|
former profiles were found."
|
||||||
(define* (scandir name #:optional (select? (const #t))
|
(define* (scandir name #:optional (select? (const #t))
|
||||||
(entry<? (@ (ice-9 i18n) string-locale<?)))
|
(entry<? (@ (ice-9 i18n) string-locale<?)))
|
||||||
|
@ -140,10 +140,11 @@ former profiles were found."
|
||||||
(() ; no profiles
|
(() ; no profiles
|
||||||
'(0))
|
'(0))
|
||||||
((profiles ...) ; former profiles around
|
((profiles ...) ; former profiles around
|
||||||
(map (compose string->number
|
(sort (map (compose string->number
|
||||||
(cut match:substring <> 1)
|
(cut match:substring <> 1)
|
||||||
(cute regexp-exec (profile-regexp profile) <>))
|
(cute regexp-exec (profile-regexp profile) <>))
|
||||||
profiles))))
|
profiles)
|
||||||
|
<))))
|
||||||
|
|
||||||
(define (previous-generation-number profile number)
|
(define (previous-generation-number profile number)
|
||||||
"Return the number of the generation before generation NUMBER of
|
"Return the number of the generation before generation NUMBER of
|
||||||
|
|
Loading…
Reference in New Issue