All of lore.kernel.org
 help / color / mirror / Atom feed
From: adrian15 <adrian15@raulete.net>
To: grub-devel@gnu.org
Subject: Re: test -e patch
Date: Tue, 05 Jun 2007 19:32:17 +0200	[thread overview]
Message-ID: <46659E21.5010805@raulete.net> (raw)
In-Reply-To: <200706041604.l54G4p0v029961@correoredir01.dinaserver.com>

> 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 ?


> 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 ?

Or have you coded it yourself too?

>> > How the hell should I treat grub errors. Maybe the test_file_exists has
>> > to return a static grub_err_t and then from grub_cmd_test I should call
>> > it like this: return (test_file_exists (args[0])) so that the error
>> > propagates ?
> 
> Right.  Otherwise the error will be lost.

Ok. I will try that every function propagates errors.

> 
>> > What are the error polices ?
> 
> Returning the err_t that grub_error returns when possible.
Ok.
>> > One question. Should we put the test-e function into a separate file or
>> > not ?
> 
> 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.

>> > 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 ?

>> > +static void
>> > +test_file_exists (const char *key)
> 
> Why not filename?

test_filename_exists
or
filename

?

>> >  {
>> > +
> 
> You accidently introduced a whiteline.

No whitelines after an initial {. I write down it.

>> > +  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.


adrian15




       reply	other threads:[~2007-06-05 17:32 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 ` adrian15 [this message]
2007-06-05 18:13   ` test -e patch Marco Gerards
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=46659E21.5010805@raulete.net \
    --to=adrian15@raulete.net \
    --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.