From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MKLgo-00028n-CE for mharc-grub-devel@gnu.org; Fri, 26 Jun 2009 20:22:42 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MKLgm-00025G-80 for grub-devel@gnu.org; Fri, 26 Jun 2009 20:22:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MKLgh-0001wg-7R for grub-devel@gnu.org; Fri, 26 Jun 2009 20:22:39 -0400 Received: from [199.232.76.173] (port=60846 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MKLgg-0001wH-V4 for grub-devel@gnu.org; Fri, 26 Jun 2009 20:22:35 -0400 Received: from mx20.gnu.org ([199.232.41.8]:15988) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MKLgg-0006uD-Iw for grub-devel@gnu.org; Fri, 26 Jun 2009 20:22:34 -0400 Received: from c60.cesmail.net ([216.154.195.49]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MKLgf-0004kA-VC for grub-devel@gnu.org; Fri, 26 Jun 2009 20:22:34 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 26 Jun 2009 20:22:30 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id 03A3D34C6D for ; Fri, 26 Jun 2009 20:29:17 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: <1245695500.1926.10.camel@mj> <1245697145.1926.11.camel@mj> <1245698882.24040.1.camel@mj> <1245701210.2754.12.camel@mj> <1245795036.3204.26.camel@mj> Content-Type: text/plain Date: Fri, 26 Jun 2009 20:22:30 -0400 Message-Id: <1246062150.20234.70.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 (2.26.2-1.fc11) Content-Transfer-Encoding: 7bit X-Detected-Operating-System: by mx20.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: Re: [PATCH] File access library for lua 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: Sat, 27 Jun 2009 00:22:40 -0000 On Wed, 2009-06-24 at 12:41 +0800, Bean wrote: > Oh, fixed typos now. As for "Windows Vista bootmgr" and "Windows > NT/2000/XP loader", I just copy them from 10_windows.in, I guess there > is a reason for it there. I don't think so. > > inird should be initrd. Please add check for the Fedora style names for > > initrd, namely "initrd-KVER.img". Or maybe you just missed ".img" in > > the second check? > > > > Add the test for initrd-KVER.img. Is there any distro that uses > initrd-KVER ? if not, I can just remove the second test. Actually, I think SUSE uses initrd-KVER (no SUSE around, but Google seems to confirm it), Fedora uses initrd-KVER.img and Debian uses initrd.img-KVER, so we need to support all three. > >> Extend the function of grub.file_exist to allow testing multiple names > >> at the same time, this simplify osdetect.lua. > > > > The change to grub_lua_file_exist() is dubious. It's not clear why the > > requirement is that all files exist. Maybe I don't know the style of > > lua, but I think it's wrong to hardcode the AND logic just because one > > script would benefit from it. > > As lua can detect the number of parameter quite easily, I just think > it'd be a waste not to utilize it. If you always call it with one > parameter, then it's equivalent to the previous file_exist. It's just > a little more code in c, but it can reduce the number of calls between > c and lua. I think it's not nice to add bells and whistles to a basic function checking existence of a file. Imagine if libc did is, and stat() would take a list of files. > > If we consider e.g. the wildcard expansion in make, it will return a > > non-empty value if any file exists, i.e. the OR logic is used. > > > > We can add a new function that uses OR logic instead of AND, for > example, grub.file_exist_any, and the current AND version can be > called grub.file_exist_all. Can we implement them in lua? I think it would be better than to implement them in C. -- Regards, Pavel Roskin