From 3e0b5582eff8a6a7b3d34d12ae16a21d29f0827c Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Tue, 25 Feb 2014 09:22:47 +0100 Subject: [PATCH] do not use release in tag names in master branch Releases are useful to have only in rhel branches. Master branch which is used as a source for Fedora and other distributions does not need them. They are in fact excessive. Stripping them off makes the tarballs consistent with other upstream projects. --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 810c9d7..f71a416 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,12 @@ NAME=hwdata VERSION=$(shell awk '/Version:/ { print $$2 }' hwdata.spec) RELEASE=$(shell rpm -q --define 'dist %{nil}' --specfile --qf "%{release}" hwdata.spec) +ifeq ($(shell git rev-parse --abbrev-ref HEAD | sed -n 's/^\([^-]\+\).*/\1/p'), rhel) + # add revision to tag name for rhel branches + TAGNAME := $(NAME)-$(VERSION)-$(REVISION) +else + TAGNAME := $(NAME)-$(VERSION) +endif SOURCEDIR := $(shell pwd) CVSROOT = $(shell cat CVS/Root 2>/dev/null || :) @@ -33,12 +39,12 @@ commit: git commit -a ||: tag: - @git tag -s -m "Tag as $(NAME)-$(VERSION)-$(RELEASE)" $(NAME)-$(VERSION)-$(RELEASE) - @echo "Tagged as $(NAME)-$(VERSION)-$(RELEASE)" + @git tag -s -m "Tag as $(TAGNAME)" $(TAGNAME) + @echo "Tagged as $(TAGNAME)" force-tag: - @git tag -f $(NAME)-$(VERSION)-$(RELEASE) - @echo "Tag forced as $(NAME)-$(VERSION)-$(RELEASE)" + @git tag -s -f $(TAGNAME) + @echo "Tag forced as $(TAGNAME)" changelog: @rm -f ChangeLog -- 2.25.1