Hi Mattia,

thanks for the reply and the patch:

the patch works fine for me with -g, but --changes-option=-g fails with:

/bin/bash: line 1: unexpected EOF while looking for matching `''
/bin/bash: line 2: syntax error: unexpected end of file
gbp:error: 'git-pbuilder --changes-option=-g' failed: it exited with 2

because the perl strips the last '
```
+ echo 'dpkg-buildpackage -S -us -uc -rfakeroot  
'\''--changes-option=-g'\'''
+ perl -pe 's/(^|\s|=)['\'']?-[AbBFgG]['\'']?(\s|$)/$1$2/g'
dpkg-buildpackage -S -us -uc -rfakeroot   '--changes-option=
+ perl -pe 's/(^|\s|=)['\'']?-[AbBFgG]['\'']?(\s|$)/$1$2/g'
+ echo 'dpkg-buildpackage -S -us -uc -rfakeroot  
'\''--changes-option=-g'\'''
+ /bin/bash
/bin/bash: line 1: unexpected EOF while looking for matching `''
/bin/bash: line 2: syntax error: unexpected end of file
gbp:error: 'git-pbuilder --changes-option=-g' failed: it exited with 2
```

I think the regex has to be split in two:

        perl -pe 's/(^|\s|=|'\'')?-[AbBFgG]?('\''|\s|$)/$1$2/g' | \
        perl -pe 's/(^|\s|=)['\'']['\''](\s|$)/$1$2/g' | \

which works for me fine

Cheers,
Ondrej

On Mon, Dec 21, 2015, at 03:44, Mattia Rizzolo wrote:
> control: tag -1 patch
> 
> Hi Ondřej!
> 
> Sorry for the late reply...
> 
> On Wed, Apr 08, 2015 at 04:15:23PM +0200, Ondřej Surý wrote:
> > pdebuild doesn't work with -g or with any binary option given in
> 
> the -g bit was fixed some releases ago as part of another bug.
> 
> > --changes-option, simple workaround fixes that:
> 
> --changes-option is something totally new for me, instead.  I usually
> pass only -g/-b/.... without expliciting those are flags for
> dpkg-genchanges, since dpkg-buildpackage seems to be is clever enough.
> 
> > echo "dpkg-buildpackage -S -us -uc -r${BUILDSOURCEROOTCMD} $DEBBUILDOPTS" | 
> > \
> >     perl -pe 's/(^|\s|=)-[AbBFg](\s|$|'\'')/$1-S$2/g' | \
> >     /bin/bash
> > 
> > Add = as a start delimiter and ' as end delimiter and -g to the list
> > of stripped options.  It's probably not a complete solution, but it
> > helps right now to build with --changes-option=-g that I use almost
> 
> that regex is tricky (see #802800), can you please check whether the
> attached patch (which just adds '|=' in the the (^|\s)) works fine for
> you?
> it looks quite harmless, but you never know...
> 
> -- 
> regards,
>                         Mattia Rizzolo
> 
> GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
> more about me:  http://mapreri.org                              : :'  :
> Launchpad user: https://launchpad.net/~mapreri                  `. `'`
> Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-
> Email had 2 attachments:
> + patch
>   1k (text/plain)
> + signature.asc
>   1k (application/pgp-signature)


-- 
Ondřej Surý <ond...@sury.org>
Knot DNS (https://www.knot-dns.cz/) – a high-performance DNS server

Reply via email to