[devscripts] 04/06: debchange: twak the "automatic set targe distribution" regex so it can matches also backports

Adam D. Barratt adam at adam-barratt.org.uk
Sun Nov 12 10:46:35 UTC 2017


On Sat, 2017-11-11 at 23:16 +0000, Mattia Rizzolo wrote:
>     debchange: twak the "automatic set targe distribution" regex so
> it can matches also backports
>     
>     Looking at that regex now I doubt it ever matched anything before
> (even
>     before this little refactoring), as it used to check for
> 'bpo(\d+)\+$'
>     or 'deb(\d+)u$', i.e. a version ending with + or u.  Also the
> logic
>     after that feels fishy to me.   But let's keep this chunk of code
> around
>     until somebody gets the time to do a proper, real overhoul of
>     everything.
> 

I think it was actually correct, if you follow through the logic from
the parent block.

The version is parsed as:

	$VERSION =~ /(.*?)([a-yA-Y][a-zA-Z]*|\d+)([+~])?$/i;

with $start being set to the first captured group. Some quick testing
indicates that this results in, for example:

    1.2-3+deb9u1 => 1.2-3+deb9u
    1.2-3~bpo90+1 => 1.2-3~bpo90+

    (Whether that's logical is an entirely different question.)

    Regards,

    Adam



More information about the devscripts-devel mailing list