[systemd-devel] [PATCH] ignore comments in multiline variable definitions

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Feb 13 11:05:07 PST 2013


On Wed, Feb 13, 2013 at 07:41:54PM +0100, Lennart Poettering wrote:
> On Wed, 13.02.13 05:26, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> 
> > 
> > On Wed, Feb 13, 2013 at 04:27:49AM +0100, Lennart Poettering wrote:
> > > On Thu, 07.02.13 11:45, Michal Vyskocil (mvyskocil at suse.cz) wrote:
> > > 
> > > > Commented lines are ignored by default and are considered as end of a
> > > > definition. If they ends on a backslash, they are just ignored and a
> > > > next line is considered as a part of a definition.
> > > 
> > > I am pretty sure that continuation lines should top comments, not the
> > > other way round. I fixed a couple of bugs in the code a few days ago,
> > > but I figure the current git code looks pretty OK now, and does honour
> > > continuation line before comments.
> > > 
> > > Anything left to do here?
> >
> > How about reversing the behaviour to honour comments before
> > continuation lines? This goes against customary behaviour, but
> > seems quite useful for unit files, since any line can be commented
> > out without editing any other line.
> 
> In the shell at least continuation lines trump comments. Just type this
> into your bash:
> 
> echo foo\
> #waldo
> 
> And it will output:
> 
> foo#waldo
> 
> And I am pretty sure we should follow the shell in this regard, after
> all these env files are supposed to be a subset of shell...
Actually, the syntax already is _not_ a subset of the shell, and has its
own pecularities. Anyone trying to blindly follow shell rules is going
to be severly bitten anyway. So, why not go a bit further and change
the syntax in a way that is useful for our users?

Zbyszek


More information about the systemd-devel mailing list