From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] File access library for lua
Date: Fri, 26 Jun 2009 20:22:30 -0400 [thread overview]
Message-ID: <1246062150.20234.70.camel@mj> (raw)
In-Reply-To: <ca0f59980906232141i648c03a6s3ac92863b51e807b@mail.gmail.com>
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
next prev parent reply other threads:[~2009-06-27 0:22 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-21 11:33 [PATCH] File access library for lua Bean
2009-06-22 0:42 ` Pavel Roskin
2009-06-22 3:38 ` Bean
2009-06-22 3:45 ` Pavel Roskin
2009-06-22 9:44 ` Robert Millan
2009-06-22 10:26 ` Bean
2009-06-22 10:59 ` Robert Millan
2009-06-22 17:37 ` Bean
2009-06-22 18:31 ` Pavel Roskin
2009-06-22 18:49 ` Bean
2009-06-22 18:59 ` Pavel Roskin
2009-06-22 19:15 ` Bean
2009-06-22 19:28 ` Pavel Roskin
2009-06-22 19:50 ` Bean
2009-06-22 20:06 ` Pavel Roskin
2009-06-23 9:27 ` Bean
2009-06-23 22:10 ` Pavel Roskin
2009-06-23 22:50 ` Robert Millan
2009-06-26 23:25 ` Pavel Roskin
2009-06-24 4:41 ` Bean
2009-06-24 5:58 ` Bean
2009-06-27 0:22 ` Pavel Roskin [this message]
2009-06-27 3:53 ` Bean
2009-06-27 4:04 ` Pavel Roskin
2009-06-27 4:14 ` Bean
2009-07-05 9:59 ` Bean
2009-07-05 13:11 ` Duboucher Thomas
2009-07-05 14:28 ` Bean
2009-06-25 22:39 ` Vladimir 'phcoder' Serbinenko
2009-06-26 23:45 ` Pavel Roskin
2009-07-31 8:07 ` Marco Gerards
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1246062150.20234.70.camel@mj \
--to=proski@gnu.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.