aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJan Macku <jamacku@redhat.com>2021-09-01 13:49:39 +0200
committerGitHub <noreply@github.com>2021-09-01 13:49:39 +0200
commit05a725a131ca5018a0d9bc09e4ac6738aaa05269 (patch)
tree34e50a2bc7aabc862112e8ed8d0393623092a741 /Makefile
parent03429d3175c401d5728431d626d9e2ce087b42ec (diff)
downloadinitscripts-05a725a131ca5018a0d9bc09e4ac6738aaa05269.tar
initscripts-05a725a131ca5018a0d9bc09e4ac6738aaa05269.tar.gz
initscripts-05a725a131ca5018a0d9bc09e4ac6738aaa05269.tar.bz2
initscripts-05a725a131ca5018a0d9bc09e4ac6738aaa05269.tar.xz
initscripts-05a725a131ca5018a0d9bc09e4ac6738aaa05269.zip
spec: Replace not working awk command with sed (#387)
Sed command get version number from spec file and increment last number by one. Work like old awk command was intended to work. Source: https://stackoverflow.com/questions/14348432/how-to-find-replace-and-increment-a-matched-number-with-sed-awk/14348899 (cherry picked from commit bfda3cc2acdea827909e6c89bda5bbb5140cda6c)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4d77e363..eb67cc0c 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@ localstatedir = /var
sharedstatedir = $(localstatedir)/lib
VERSION := $(shell gawk '/Version:/ { print $$2 }' initscripts.spec)
-NEXT_VERSION := $(shell gawk '/Version:/ { print $$2 + 0.01 }' initscripts.spec)
+NEXT_VERSION := $(shell sed -nr 's/Version:[ ]*([0-9]*)\.([0-9]*)\.([0-9]*)/echo "\1\.\2\.$$((\3+1))"/gep' initscripts.spec)
all: make-binaries make-translations