From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1S4E7M-00065W-1N for mharc-grub-devel@gnu.org; Sun, 04 Mar 2012 11:17:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4E7J-000651-GK for grub-devel@gnu.org; Sun, 04 Mar 2012 11:17:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4E6z-0003VC-G4 for grub-devel@gnu.org; Sun, 04 Mar 2012 11:17:01 -0500 Received: from wp191.webpack.hosteurope.de ([80.237.132.198]:59398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4E6z-0003UA-7q for grub-devel@gnu.org; Sun, 04 Mar 2012 11:16:41 -0500 Received: from p54ba7451.dip.t-dialin.net ([84.186.116.81] helo=neptun.omega.ssw.de); authenticated by wp191.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1S4E6w-0000OS-56; Sun, 04 Mar 2012 17:16:38 +0100 Received: from localhost (localhost [127.0.0.1]) by neptun.omega.ssw.de (Postfix) with ESMTP id 567BCE180A8; Sun, 4 Mar 2012 17:16:37 +0100 (CET) X-Virus-Scanned: amavisd-new at omega.ssw.de Received: from neptun.omega.ssw.de ([127.0.0.1]) by localhost (neptun.omega.ssw.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MjCSkyLQo9fp; Sun, 4 Mar 2012 17:16:26 +0100 (CET) Received: from [192.168.2.43] (p640.fritz.box [192.168.2.43]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by neptun.omega.ssw.de (Postfix) with ESMTP id 940FCE180A7; Sun, 4 Mar 2012 17:16:26 +0100 (CET) Message-ID: <4F539556.4070709@anvo-it.de> Date: Sun, 04 Mar 2012 17:16:22 +0100 From: Andreas Vogel User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= Subject: Re: [PATCH] Making exported variables really global References: <4F536941.8070805@anvo-it.de> <4F536B8A.6060501@gmail.com> <4F537261.3070402@anvo-it.de> <4F5377CA.4020709@gmail.com> In-Reply-To: <4F5377CA.4020709@gmail.com> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-bounce-key: webpack.hosteurope.de; andreas.vogel@anvo-it.de; 1330877801; a2cb6189; X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.237.132.198 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2012 16:17:02 -0000 Am 04.03.2012 15:10, schrieb Vladimir '=CF=86-coder/phcoder' Serbinenko: > On 04.03.2012 14:47, Andreas Vogel wrote: >> Am 04.03.2012 14:18, schrieb Vladimir '=CF=86-coder/phcoder' Serbinenk= o: >>> 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. Thi= s >>>> patch sets and exports all vars in the calling context for the subme= nu >>>> which are exported in the context of the submenu. >>> We follow the bash behaviour. And the bash behaviour is exactly what >>> GRUB does: >>> phcoder@debian.x201.phnet:14:15:11:~/grub2/bzr/mainline$ bash >>> phcoder@debian.x201.phnet:14:15:15:~/grub2/bzr/mainline$ export XYZ=3D= x >>> phcoder@debian.x201.phnet:14:15:19:~/grub2/bzr/mainline$ exit >>> phcoder@debian.x201.phnet:14:15:20:~/grub2/bzr/mainline$ echo $XYZ >>> >>> phcoder@debian.x201.phnet: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)=20 Yes, that's one possible solution. Why establishing a new command instead of using an option for submenu, let's say "--export 0|1"?