unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mathieu Othacehe <m.othacehe@gmail.com>
To: Mark H Weaver <mhw@netris.org>
Cc: Vagrant Cascadian <vagrant@debian.org>, 31159@debbugs.gnu.org
Subject: bug#31159: Reverse order for old grub.cfg entries
Date: Tue, 17 Apr 2018 10:16:07 +0200	[thread overview]
Message-ID: <87a7u2qmd4.fsf@gmail.com> (raw)
In-Reply-To: <87y3hnnru3.fsf@netris.org>

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]


Hi,

This seems like a good idea ! If we decide to make it unconditional the
patch attached does the job. We can also make it configurable in
bootloader-configuration for instance.

WDYT ?

Mathieu

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-scripts-system-Sort-profile-generations-in-reverse-o.patch --]
[-- Type: text/x-diff, Size: 1545 bytes --]

From 3ec63fb55a074b547724c70d560cc61776c9298e Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
Date: Tue, 17 Apr 2018 09:23:00 +0200
Subject: [PATCH] scripts: system: Sort profile generations in reverse order.

* guix/scripts/system.scm (profile-boot-parameters): Reverse
generation-numbers list. This allows old generations to be listed from most
recent to oldest in bootloaders configuration files.
---
 guix/scripts/system.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index b50cabc..7e1363c 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -393,9 +393,11 @@ it atomically, and then run OS's activation script."
                   "~Y-~m-~d ~H:~M")))
 
 (define* (profile-boot-parameters #:optional (profile %system-profile)
-                                  (numbers (generation-numbers profile)))
-  "Return a list of 'boot-parameters' for the generations of PROFILE specified by
-NUMBERS, which is a list of generation numbers."
+                                  (numbers
+                                   (reverse (generation-numbers profile))))
+  "Return a list of 'boot-parameters' for the generations of PROFILE specified
+by NUMBERS, which is a list of generation numbers. The list is ordered from
+the most recent to the oldest profiles."
   (define (system->boot-parameters system number time)
     (unless-file-not-found
      (let* ((params           (read-boot-parameters-file system))
-- 
2.7.4


[-- Attachment #3: Type: text/plain, Size: 680 bytes --]



Mark H Weaver writes:

> Vagrant Cascadian <vagrant@debian.org> writes:
>
>> This is a pretty minor issue, but I've found that the "GNU system, old
>> configurations..." part of the menu would be nicer if the most recent
>> generations were listed at the top, rather than the oldest generations.
>>
>> Currently it lists generation 1 as the first entry in the list, and if
>> I've got 50+ generations installed and I don't want to boot the current
>> generation, I'm most likely going to want to revert to one of the more
>> recent generations rather than the very oldest.
>
> I agree that it would be better to reverse the order of these entries.
>
>     Thanks,
>       Mark


  reply	other threads:[~2018-04-17  8:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87r2lsji3l.fsf@lassieur.org>
2018-04-15  3:20 ` bug#31159: Reverse order for old grub.cfg entries Vagrant Cascadian
2018-04-15 17:22   ` Joshua Branson
2018-04-16 14:33   ` Mark H Weaver
2018-04-17  8:16     ` Mathieu Othacehe [this message]
2018-04-17 18:18       ` Mark H Weaver
2018-04-18 14:04         ` Ludovic Courtès
2018-04-18 19:23           ` Mark H Weaver
2018-04-18 20:14             ` Ludovic Courtès
2018-04-19 15:21               ` Mathieu Othacehe
2018-04-23 15:16                 ` Ludovic Courtès
     [not found]   ` <handler.31159.C.152775849827440.notifdonectrl.0@debbugs.gnu.org>
2018-05-31 22:07     ` bug#31159: #31159: " Vagrant Cascadian
2018-06-01  2:18       ` Mark H Weaver
2018-06-01  7:46         ` Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a7u2qmd4.fsf@gmail.com \
    --to=m.othacehe@gmail.com \
    --cc=31159@debbugs.gnu.org \
    --cc=mhw@netris.org \
    --cc=vagrant@debian.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).