From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MMF4W-0002Gq-2K for mharc-grub-devel@gnu.org; Thu, 02 Jul 2009 01:43:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MMF4T-0002Gl-Uh for grub-devel@gnu.org; Thu, 02 Jul 2009 01:42:57 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MMF4N-0002BZ-RU for grub-devel@gnu.org; Thu, 02 Jul 2009 01:42:56 -0400 Received: from [199.232.76.173] (port=57848 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMF4N-0002BE-HC for grub-devel@gnu.org; Thu, 02 Jul 2009 01:42:51 -0400 Received: from vader.rez-gif.supelec.fr ([160.228.154.1]:43316) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MMF4N-0005B4-06 for grub-devel@gnu.org; Thu, 02 Jul 2009 01:42:51 -0400 Received: from localhost (localhost [127.0.0.1]) by vader.rez-gif.supelec.fr (Postfix) with ESMTP id 68DA22C6A55 for ; Thu, 2 Jul 2009 07:42:49 +0200 (CEST) X-Virus-Scanned: amavisd-new at rez-gif.supelec.fr Received: from vader.rez-gif.supelec.fr ([127.0.0.1]) by localhost (vader.rez-gif.supelec.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DPjdtCXAlxMx for ; Thu, 2 Jul 2009 07:42:46 +0200 (CEST) Received: from [127.0.0.1] (duboucher2.rez-gif.supelec.fr [160.228.159.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by vader.rez-gif.supelec.fr (Postfix) with ESMTPS id 3EE302C6A50 for ; Thu, 2 Jul 2009 07:42:46 +0200 (CEST) Message-ID: <4A4C48CF.5090609@duboucher.eu> Date: Thu, 02 Jul 2009 07:42:39 +0200 From: Duboucher Thomas User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: The development of GRUB 2 References: <4A4BE47C.7060602@duboucher.eu> <1246497257.8806.6.camel@mj> In-Reply-To: <1246497257.8806.6.camel@mj> X-Enigmail-Version: 0.95.7 OpenPGP: id=A79F86A8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: Bug in gencmdlist.sh (or is it?) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jul 2009 05:42:58 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Pavel Roskin a =E9crit : > On Thu, 2009-07-02 at 00:34 +0200, Duboucher Thomas wrote: >=20 >> I was working on some Grub2 module a few days ago and I spent a lot o= f >> time on this. Basically, I was unable to correctly generate the file >> command.lst; my new commands simply didn't appeared in it. >> I finally found that gencmdlist.sh is only processing line per line >> using sed, so that if one is writing with a different indentation, the >> script silently fail. For instance, >>> grub_extcmd >>> ( >>> "foo", >> does not produce any output. >=20 > I confirm that it's indeed a limitation of gencmdlist.sh. It may be > possible to handle it by using C preprocessor before sed, but I don't > think it's an urgent issue. It's shouldn't be a problem for properly > indented source. No, it is not really urgent. As I said, I have already found a workaround. But based on Grub2 being a module-based project, I don't think an indentation-dependant parser is a good idea, nor is it robust. >=20 >> I am working now with a small script >> written in Lua, but it is neither efficient, nor a good idea to add Lu= a >> as a dependency. >=20 > I don't understand how this is related. >=20 I have replaced gencmdlist.sh by a script in Lua that does the same, and can handle any kind of indentation - or at least the resulting file is identical even if I mess the indentation; but based on how and when I have writen it, well, I'm not very confident ;) -. >> Perhaps a sed guru can have a look at this? >=20 > I actually don't feel good about using anything other that a C compiler > or preprocessor to parse C sources. >=20 > It's working for now, but if we want to make it more reliable, I'd > rather not ask a "sed guru". >=20 There are tools to parse source code, but that is not my domain. That's the reason I was reporting this. :) Regards, Thomas. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkpMSM8ACgkQBV7eXqefhqgzGwCcD5cXmwsCREdwNUBjgvACc9xK xxoAoLIBToOcZ5oig5T/ihd9av/wioed =3D6XCt -----END PGP SIGNATURE-----