From 99882c613ca29d0020f507b76cc6da955dd70afa Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 21 Sep 2013 22:35:14 +0200 Subject: guix package: Sort the list of generation numbers in '--list-generations'. * guix/scripts/package.scm (generation-numbers): Sort the result. --- guix/scripts/package.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index dcc2bc74aa..c0cedcd4a8 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -97,7 +97,7 @@ "-([0-9]+)"))) (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." (define* (scandir name #:optional (select? (const #t)) (entrynumber - (cut match:substring <> 1) - (cute regexp-exec (profile-regexp profile) <>)) - profiles)))) + (sort (map (compose string->number + (cut match:substring <> 1) + (cute regexp-exec (profile-regexp profile) <>)) + profiles) + <)))) (define (previous-generation-number profile number) "Return the number of the generation before generation NUMBER of -- cgit 1.4.1