[aur-dev] [PATCH] Fix: FS#13122 - simpler commented line removal

Gergely Imreh imrehg at gmail.com
Mon Feb 16 21:08:50 EST 2009

2009/2/17 Loui Chang <louipc.ist at gmail.com>:
> On Mon, Feb 16, 2009 at 10:45:33PM +0800, Gergely Imreh wrote:
>> How about this new version? Handles FS#13122 and FS#13173 well - by
>> which I mean that it does not remove anything that is not comment. The
>> # characters intended for bash parameter replacement are kept (so not
>> breaking the upload), though not handled yet within the replacement
>> section. That is for another day.
> I pushed a modded version of your patch, so it's attributed to you.
> It only neutralises the parameter substitution, though.

You shouldn't attribute that commit to me, because it has absolutely
nothing to do with the patch I sent in, it's totally yours... I'm not
even sure what "neutralises" mean in this situation, yet.... Got to
figure out the changes now. :)

As for your previous comment about foo=bar;#none, that could be
handled with my version with some change, using this regular
expression replacement:
$line = preg_replace('/(;*)(^|\s+)#.*/', "$1", $line);
This version handles things as:
#none -> (empty line)
foo=bar;#none -> foo=bar;
foo=bar #none -> foo=bar
foo=bar          #none -> foo=bar
foo=${bar#none} -> foo=${bar#none}
foo=${bar##none} -> foo=${bar##none}
foo=${bar #none} -> foo=${bar
The last one would result we handle in the parameter substitution
(although wrong), but that's fine since it breaks bash, so it's a
Is there any other case that is not handled? You obviously know more
about bash than I have known before, so please let me know, and I can
handle them in the same time. Well, even if it won't make it into a
patch, I'd really wanna know.


More information about the aur-dev mailing list