From: Jeremy Cline jcline@redhat.com
ARK's master branch tracks Linus's master branch, so drop the check for a remote named "linus" (which might be wrong anyway) and use the local master branch to calculate the snapshot.
While this does assume that the local master branch is up-to-date, that's better than trying to guess the correct remote name and can be easily scripted.
Cc: Frantisek Hrbata fhrbata@redhat.com Cc: Rado Vrbovsky rvrbovsk@redhat.com Cc: Jeremy Cline jcline@redhat.com Cc: Luis Claudio Goncalves lgoncalv@redhat.com Cc: Denys Vlasenko dvlasenk@redhat.com Cc: "Herton R. Krzesinski" herton@redhat.com Cc: Juri Lelli jlelli@redhat.com Cc: Jan Stancek jstancek@redhat.com Cc: Clark Williams williams@redhat.com Signed-off-by: Jeremy Cline jcline@redhat.com --- redhat/Makefile.common | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/redhat/Makefile.common b/redhat/Makefile.common index a3b16c8a50f2..d980847aacc7 100644 --- a/redhat/Makefile.common +++ b/redhat/Makefile.common @@ -41,17 +41,11 @@ else VERSION_ON_UPSTREAM:=0 endif ifeq ($(VERSION_ON_UPSTREAM),1) - # In order to do a snapshot properly, we need to have a remote set up - # to track upstream. - _HAVE_UPSTREAM_REMOTE:=$(shell git remote | grep -wc linus) - ifeq ($(_HAVE_UPSTREAM_REMOTE),1) - MERGE_BASE:=$(shell git merge-base HEAD linus/master) - TAG:=$(shell git describe $(MERGE_BASE)) - # a snapshot off of a tagged git is of the form [tag]-[cnt]-g[hash] - SNAPSHOT:=$(shell echo $(TAG) | grep -c '-g') - else - SNAPSHOT:=0 - endif + # master is expected to track mainline. + MERGE_BASE:=$(shell git merge-base HEAD master) + TAG:=$(shell git describe $(MERGE_BASE)) + # a snapshot off of a tagged git is of the form [tag]-[cnt]-g[hash] + SNAPSHOT:=$(shell echo $(TAG) | grep -c '-g') else SNAPSHOT:=0 endif