diff options
author | Jan Macku <jamacku@redhat.com> | 2021-09-14 10:51:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-14 10:51:31 +0200 |
commit | 011100df7837c89682d9da777e959a4a9224dcfa (patch) | |
tree | 142a870110a78ab5febe65ff2199fb373904eeaa /Makefile | |
parent | 6826a89d82bedb72e14a91199591770c5fa36401 (diff) | |
download | initscripts-011100df7837c89682d9da777e959a4a9224dcfa.tar initscripts-011100df7837c89682d9da777e959a4a9224dcfa.tar.gz initscripts-011100df7837c89682d9da777e959a4a9224dcfa.tar.bz2 initscripts-011100df7837c89682d9da777e959a4a9224dcfa.tar.xz initscripts-011100df7837c89682d9da777e959a4a9224dcfa.zip |
spec: Fix issue with $NEXT_VERSION (#390)
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -32,7 +32,13 @@ localstatedir = /var sharedstatedir = $(localstatedir)/lib VERSION := $(shell gawk '/Version:/ { print $$2 }' initscripts.spec) -NEXT_VERSION := $(shell sed -nr 's/Version:[ ]*([0-9]*)\.([0-9]*)\.([0-9]*)/echo "\1\.\2\.$$((\3+1))"/gep' initscripts.spec) +# NOTE: First check version type. We currently support two types: +# * upstream version ##.## (e.g. 10.01) +# * downstream version ##.##.## (e.g. 10.01.1) +# Then based on type of version, increment last number by one using sed - https://stackoverflow.com/a/14348899 +NEXT_VERSION := $(shell grep -q "^Version:[ ]*[0-9]*\.[0-9]*$$" initscripts.spec && \ + sed -nr 's/Version:[ ]*([0-9]*)\.([0-9]*)/echo "\1\.$$((\2+1))"/gep' initscripts.spec || \ + sed -nr 's/Version:[ ]*([0-9]*)\.([0-9]*)\.([0-9]*)/echo "\1\.\2\.$$((\3+1))"/gep' initscripts.spec) all: make-binaries make-translations |