grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Making exported variables really global


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] Making exported variables really global
Date: Sun, 04 Mar 2012 15:10:18 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0

On 04.03.2012 14:47, Andreas Vogel wrote:
Am 04.03.2012 14:18, schrieb Vladimir 'φ-coder/phcoder' Serbinenko:
On 04.03.2012 14:08, Andreas Vogel wrote:
Hi all,

This tiny patch makes exported variables really global. Right now
exported variables are set in the context of a submenu when running it.
But any changes to those vars are lost when leaving the submenu. This
patch sets and exports all vars in the calling context for the submenu
which are exported in the context of the submenu.
We follow the bash behaviour. And the bash behaviour is exactly what
GRUB does:
address@hidden:14:15:11:~/grub2/bzr/mainline$ bash
address@hidden:14:15:15:~/grub2/bzr/mainline$ export XYZ=x
address@hidden:14:15:19:~/grub2/bzr/mainline$ exit
address@hidden:14:15:20:~/grub2/bzr/mainline$ echo $XYZ

address@hidden:14:15:24:~/grub2/bzr/mainline$

I understand your point, but IMHO we do need to be able to set global
vars in submenus, that's my patch about.

Otherwise how can you use a "Settings..." submenu to configure
environment variables which are used by other menu entries for booting?
The analogy with bash is not useful here.
We can add a command with traits of both "menuentry" (same context, same menu) and "submenu" (new context, new menu), sth like submemu_source (same context, new menu)



--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko




reply via email to

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