From 0e2203a96a34038d329a94110fa768b346efed9c Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Wed, 29 Aug 2018 11:31:40 +0200 Subject: [PATCH] Fix `make rpm` for unreleased code When the topmost commit isn't tagged, rpmbuild otherwise fails with error: line 2: Illegal char '-' (0x2d) in: Version: 176-1-g9101a30a Replace the dashes from `git describe` with periods, to get a valid RPM upstream version number. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9746a42..dc19f80 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # extract name from package.json PACKAGE_NAME := $(shell awk '/"name":/ {gsub(/[",]/, "", $$2); print $$2}' package.json) -VERSION := $(shell git describe 2>/dev/null || echo 1) +VERSION := $(shell T=$$(git describe 2>/dev/null) || T=1; echo $$T | tr '-' '.') ifeq ($(TEST_OS),) TEST_OS = centos-7 endif