packpack / packpack

Simple building of RPMs & Debian packages from git repos
Other
286 stars 54 forks source link

Document how to override VERSION and RELEASE #50

Open rtsisyk opened 7 years ago

rtsisyk commented 7 years ago

From @SteveGilvarry:

We probably need to drop the v on our version number, so that is less of an issue. Your example is correct, but not what git describe, which creates VERSION, would return which would be like this 1.30.0-rc1-14-geef95da. Currently the sed in build would fail when it gets anything non-numeric after first dash. 1.30.0-14-geef95da works 1.30.0-rc1-14-geef95da fails Just a quick test gave me the below that would return 1.30.0 always for VERSION and 14 or rc1 respectively for RELEASE, so not a complete solution as rc1 loses the 14. VERSION=$(shell cat VERSION | sed -n 's/^([0-9.])-([a-z0-9])-([a-z0-9-])/\1/p') RELEASE=$(shell cat VERSION | sed -n 's/^([0-9.])-([a-z0-9])-([a-z0-9-])/\2/p')

No solution yet so nothing to propose. Was just saying if I find a solution I would share it.

sergeyklay commented 7 years ago

How about something like https://regex101.com/r/XGROt4/1

SteveGilvarry commented 7 years ago

Yes better but ideally it needs to account for examples like you have, but then followed by Commit# and Commit hash as per git describe returns. 1.30.0-rc1-14-geef95da, so 1.30.0-rc1 is version, which will become 1.30.0 as the final version. Release is 14-geef95da. I think for now we are setting the version manually.

rtsisyk commented 7 years ago

How about something like https://regex101.com/r/XGROt4/1

I'm not sure that it is safe to use "-" in VERSION, especially for Debian packages.