From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NMj91-0006yD-LA for mharc-grub-devel@gnu.org; Mon, 21 Dec 2009 09:21:55 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMj8z-0006xh-OB for grub-devel@gnu.org; Mon, 21 Dec 2009 09:21:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMj8v-0006ww-ET for grub-devel@gnu.org; Mon, 21 Dec 2009 09:21:53 -0500 Received: from [199.232.76.173] (port=56382 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMj8v-0006wt-4w for grub-devel@gnu.org; Mon, 21 Dec 2009 09:21:49 -0500 Received: from mail-fx0-f215.google.com ([209.85.220.215]:53755) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMj8u-0000Dr-Mg for grub-devel@gnu.org; Mon, 21 Dec 2009 09:21:48 -0500 Received: by fxm7 with SMTP id 7so5239535fxm.9 for ; Mon, 21 Dec 2009 06:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=bIxZ8KCnaHk6Z0mwwxgSqVLtCke0O2NY0+pv8rpGxvY=; b=Y11HIgZWpoMroECyHnbQNq+IeVVwc8501t4fW2D247L5+TKL+9vcHEOkygo00pasfA WDaMbPCtKOg9lFbytN1sl4AutvK3dYjj20iCdlQmjwl6I+vxUJHjFSl+vEeAID4wNhLW AwPh6/Tld9PF7QeL8WFy12NGwGYHUJ4IJTNN0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=v0KJ4lHvs24FY0hLV2QjwKjgLbPsmVEwy020MJfSd7d34CsaY1zycLpbbZQMiHIq9+ f6KkjlNeZKyEHNUi6PICSXHC9SIAT6ue37dHtLng7/Hs93BfjlWtsPqHQ/ELChks0sJ2 nna79Frcb0iN0317UxYpppKR0tOrefDHzABr0= Received: by 10.86.11.33 with SMTP id 33mr435390fgk.56.1261405307817; Mon, 21 Dec 2009 06:21:47 -0800 (PST) Received: from debian.bg45.phnet (67-154.203-62.cust.bluewin.ch [62.203.154.67]) by mx.google.com with ESMTPS id d6sm21514526fga.9.2009.12.21.06.21.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Dec 2009 06:21:44 -0800 (PST) Message-ID: <4B2F8471.6080801@gmail.com> Date: Mon, 21 Dec 2009 15:21:37 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <4AD76CA5.3070102@googlemail.com> <20091015191618.GI28534@riva.ucam.org> <4AD77D60.6010207@googlemail.com> <4B1C36F6.1000504@googlemail.com> <4B27D378.1080805@googlemail.com> In-Reply-To: <4B27D378.1080805@googlemail.com> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigDD5560E6D5D826050966FBAD" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] create variables when exporting them X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Mon, 21 Dec 2009 14:21:53 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDD5560E6D5D826050966FBAD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Andreas Born wrote: > I just noticed that I forgot the header line of the diff. Sorry for tha= t. > New double checked version attached. > Applied with stylistic fixes > The Changelog is still: > 2009-12-15 Andreas Born > > * kern/env.c (grub_env_export): Create nonexistent variables > before exporting. > > Andreas Born schrieb: >> Same here. Nothing changed as of r1917 and I didn't get any further >> feedback either. >> I've attached a rediffed version, too. >> >> Andreas Born schrieb: >>> Here you go: >>> ChangeLog: >>> 2009-10-15 Andreas Born >>> >>> * kern/env.c (grub_env_export): Create nonexistent variables >>> before exporting. >>> >>> >>> The mixed indentation (tabs and spaces) in kern/env.c was a bit >>> confusing. >>> >>> Andreas >>> >>> Colin Watson schrieb: >>>> On Thu, Oct 15, 2009 at 08:40:37PM +0200, Andreas Born wrote: >>>> =20 >>>>> This patch changes grub_env_export to create variables with empty >>>>> value, if necessary. >>>>> This makes it possible to export variables before actually >>>>> assigning them any value and is the way bash behaves. >>>>> =20 >>>> >>>> This makes sense to me (although bash is "too big and too slow" and >>>> we'll never implement anything close to all of it, this is a pretty >>>> cheap way to reduce confusion due to differences), although >>>> probably for >>>> post-1.97. A couple of nits: >>>> >>>> =20 >>>>> * kern/env.c (grub_env_export): Create inexistent >>>>> variables before exporting. >>>>> =20 >>>> >>>> "nonexistent" >>>> >>>> =20 >>>>> + if (! var) >>>>> + { >>>>> + if (grub_env_set (name, "") !=3D GRUB_ERR_NONE) >>>>> + return grub_errno; >>>>> + var =3D grub_env_find (name); >>>>> + } =20 >>>> >>>> GNU brace style involves indenting the braces as well, thus: >>>> >>>> if (! var) >>>> { >>>> if (grub_env_set (name, "") !=3D GRUB_ERR_NONE) >>>> return grub_errno; >>>> var =3D grub_env_find (name); >>>> } =20 >>> >> > > -----------------------------------------------------------------------= - > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigDD5560E6D5D826050966FBAD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAksvhHcACgkQNak7dOguQgnjeQD+LBkroVavb5Le37ON5aCla0AR f/1+dTfA/C1pMVND9XkA/iqZ4dQF8VSI4Tev8RFXmEyDLPeMVuDgy+lyEnhxvozC =45FD -----END PGP SIGNATURE----- --------------enigDD5560E6D5D826050966FBAD--