[Mageia-dev] Does anyone have a script that bumps releases?
Anssi Hannula
anssi at mageia.org
Sun Mar 31 22:33:29 CEST 2013
31.03.2013 16:09, Colin Guthrie kirjoitti:
> Hi,
>
> Does anyone have a script that will bump the release of a given spec file?
>
> Obviously there are lots of different forms to set the release and I
> guess the script has to back through the definition chain to find the
> right place to "add one".
I use:
perl -pi -e
's,((?:%define\s+rel(?:ease)?\b|Release:).*[\s\.])(\d+)(})?$,$1 . ($2+1)
. $3,e' file.spec
(with some boilerplate to check if it worked)
Works on pretty much all cases except "%define foobarrel 1" style
definitions.
--
Anssi Hannula
More information about the Mageia-dev
mailing list