On Friday 14 December 2007 13:07, Michael Stapelberg wrote:
> Hi Kern,
>
> * [14.12.07 11:50]:
> > In looking at the code, I am not sure why the leading | was not skipped. 
> > In any case, it looks like a bug, so I have made the following change,
> > which should fix it:
> > [...]
>
> Yes, that's the more elegant fix, thanks for that.
>
> > Concerning modifying lex.c not to skip spaces (your second hunk at -572)
> > -- that seems to me very likely to introduce another bug.  I suspect that
> > you need it because you are not quoting the command line string with
> > double quotes.  If you want an argument to be passed in to Bacula in
> > full, you *must* enclose it in double quotes not single quotes.  So, it
> > seems to me that your example, if written as the following ...
>
> Wait a second - I'm not talking about calling bacula on the command-line.
> I'm talking about the configuration files in which you can include other
> ones, like this:
> @/etc/bacula/defaults.conf
>
> You can also specify something like this:
> @|sed 's/NAME/machine1/g' /etc/bacula/default_job.conf
> @|sed 's/NAME/machine2/g' /etc/bacula/default_job.conf
> Which should show you what I'm planning to do ;-).

Yes, well, the above without quotes will *never* work with the spaces ... it 
is just not possible with the current lexical analyzer as you have 
discovered ...

>
> > should work fine.  I haven't actually tried it though.  If that doesn't
> > work, then I suggest putting everything into a single script file.
>
> It doesn't work when I use the following:
> @"|sed 's/foo/bar/g' /tmp/bac/bacula-2.2.0/src/dird/bd.conf"
> I get the error message "No such file or directory".
>
> Apparantly, double-quoted strings aren't correctly parsed when specifying a
> filename.
>
> I've attached a patch which introduces lex_include_quoted_string and
> handles includes like this:
> @"/tmp/foo.conf"
>
> Also, you can do includes like this:
> @"sed 's/foo/bar/g' /tmp/foo.conf"

I have no problem with permitting quoted strings in a lex_include.  This will 
also help the Win32 guys who would like to be able to include filenames with 
blanks.  However, I need to look a bit more carefully at what you are 
proposing in your patch to be 100% sure, but on quick look, it seems fine to 
me.

For a patch of the size of yours, I'll need you to fill out and send in the 
FSFE FLA.  Please see  www.bacula.org -> FSFE License.  Fill out two copies, 
mail them in, then let me know by email, and I can complete the integration.

Thanks for your interest in Bacula.  I think this will be a nice addition :-)

Best regards,

Kern

> Best regards,
> Michael

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to