From: Marco Gerards <mgerards@xs4all.nl>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: test -e patch
Date: Tue, 05 Jun 2007 20:13:07 +0200 [thread overview]
Message-ID: <87tztm5ky4.fsf@xs4all.nl> (raw)
In-Reply-To: <46659E21.5010805@raulete.net> (adrian15@raulete.net's message of "Tue, 05 Jun 2007 19:32:17 +0200")
adrian15 <adrian15@raulete.net> writes:
>> adrian15 <adrian15@raulete.net> writes:
>>
>>> > Attached you will find the patch adding test -e support for grub2.
>>> >
>>> > This is my first patch. I have compiled it without no errors.
>>
>> Urgh... I thought/hoped I told you I had a test.c rewrite sitting on
>> my harddisk? Or did I tell Robert to poke me until next weekend so I
>> will work on it? It includes everything you expect from test.c,
>> expect the cleanup and testing. ;-)
>
> Do you mean you also have the '-e' option ?
I mean I have everything that is possible. That includes `-e', but
also all other features.
Something noone looked at is "expr".
>> Please have a look at the wiki. It has quite some information about
>> GRUB 2.
> Whenever possible I'll download some info from the wiki.
>
>>> > Should I write "Test if a file exists" instead of "test if a file
>>> > exists" or "FILE exists"?
>>
>> FILE
>
> FILE
> or
> FILE exists ?
FILE exists
> Or have you coded it yourself too?
Hm?
[...]
>> No, the problem is that the design of test.c (which is just a
>> placeholder) is wrong. It needs a proper parser for the arguments and
>> a way to deal with this...
>
> Ok. We will wait for your code.
:-)
Sorry for the confusion :-/
>>> > The question is if the user will see the -e, -f or other options when
>>> > querying the test command help or not ?
>>
>> They should. But I am not sure if the final version will support
>> this. Especially because of the nested syntax of the test arguments.
>
> Do you mean the -e options support
> or
> do you mean the -e options showing at help test support ?
Well, the version for GNU/Linux doesn't show help text. Perhaps it
cannot be implemented using the argument parser in a clean way. I do
not remember.
>>> > +static void
>>> > +test_file_exists (const char *key)
>>
>> Why not filename?
>
> test_filename_exists
> or
> filename
I mean instead of key.
> ?
>
>>> > {
>>> > +
>>
>> You accidently introduced a whiteline.
>
> No whitelines after an initial {. I write down it.
Well, usually adding whitespaces around code you didn't change is
wrong or dirty.
>>> > + if (state[0].set)
>>> > + test_file_exists (args[0]);
>>> > + else
>>> > + {
>>
>> This means that this check is run for any other expression. This is
>> quite error sensitive.
>
> In my code the only implemented option is '-e'. When there will be more
> I could add more nested if with the other options, or maybe better we
> will enjoy your improved code.
Sure. Just poke me a lot during the weekend on IRC ;-)
--
Marco
next prev parent reply other threads:[~2007-06-05 18:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200706041604.l54G4p0v029961@correoredir01.dinaserver.com>
2007-06-05 17:32 ` test -e patch adrian15
2007-06-05 18:13 ` Marco Gerards [this message]
2007-06-05 17:32 ` gcs doubt #1 adrian15
2007-06-05 17:56 ` Marco Gerards
2007-06-05 17:32 ` GSoC: CD-ROM booting options adrian15
2007-06-07 18:25 ` Alex Roman
2007-06-07 21:00 ` Vesa Jääskeläinen
2007-06-08 4:45 ` Alex Roman
[not found] <200706051834.l55IY56F003249@correoredir01.dinaserver.com>
2007-06-06 18:04 ` test -e patch adrian15
2007-06-05 23:42 adrian15
2007-06-02 9:07 ` Robert Millan
2007-06-02 12:05 ` Robert Millan
2007-06-04 15:26 ` Marco Gerards
[not found] <200706021604.l52G4Ar4014398@correoredir01.dinaserver.com>
2007-06-03 2:59 ` adrian15
2007-06-03 2:59 ` adrian15
2007-06-03 2:59 ` adrian15
2007-06-04 15:34 ` 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=87tztm5ky4.fsf@xs4all.nl \
--to=mgerards@xs4all.nl \
--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.