From: Jean-Marc Pigeon Date: Fri, 19 Dec 2025 21:15:27 +0000 (-0500) Subject: Starting to make mailleur an autonomous git X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=e377d3e4b872757f26c6f62fc3cc20f54b798080;p=jmp%2Fmailleur Starting to make mailleur an autonomous git --- diff --git a/Makefile b/Makefile index 24823ba..317b209 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ #default make default : clean prod #-------------------------------------------------------------------- +#Makefile with all data for GIT +include Makefile.git #test area Makefile include Makefile.dbg #distribution area Makefile diff --git a/Makefile.git b/Makefile.git new file mode 100644 index 0000000..2e8a686 --- /dev/null +++ b/Makefile.git @@ -0,0 +1,67 @@ +#-------------------------------------------------------------------- +#to prepare git function +#version change +CURTAG = $(shell git rev-parse --abbrev-ref HEAD) +BRANCH = $(shell echo $(CURTAG) | cut -d '-' -f3) +RELEASE = $(shell git rev-list --count $(CURTAG) ^tag-$(VERSION)) +VERSION = $(shell echo $(CURTAG) | cut -d'-' -f2) +NEXTREL = $(shell echo $(RELEASE) + 1 |bc) +MAILREL = $(shell echo $(VERSION)-$(NEXTREL)-$(BRANCH)) +#-------------------------------------------------------------------- +github : + @ (cd pub-mailleur ; git push --tags $@ $(BR):$(BR)) + +allcom : commit maincom + +maincom : clean + @ git add . mailleur + @ git commit -a + @ $(MAKE) -s push + +push : + git push --tags origin $$BR:$$BR ; + +commit : fclean dovers + @ ( \ + cd $(PUB) ; \ + git add . ; \ + git commit -a ; \ + git push --tags origin $$BR:$$BR ; \ + ) + +BR = $(shell git branch | sed -e '/^[^*]/d' -e 's/* //') +#-------------------------------------------------------------------- +gitcheck: + @ echo CURTAG=$(CURTAG) + @ echo BRANCH=$(BRANCH) + @ echo VERSION=$(VERSION) + @ echo RELEASE=$(RELEASE) + +#-------------------------------------------------------------------- +#to clean directory before a git commit +fclean : clean + @ rm -fr core.* + @ rm -fr srcrpm/* + +#prepare version and working dirs +dovers : + @ make -s clean + @ echo "Updating Version WITH $(BRANCH)" + @ ( \ + echo -e "#define VERSION\t\"$(VERSION)\""; \ + echo -e "#define RELEASE\t\"$(NEXTREL)\""; \ + echo -e "#define BRANCH\t\"$(BRANCH)\""; \ + ) > ./lib/numver.h + ( \ + sed \ + -e "s/=VERSION/=\"$(VERSION)\"/" \ + -e "s/=NEXTREL/=\"$(NEXTREL)\"/" \ + -e "s/=BRANCH/=\"$(BRANCH)\"/" \ + -e "s/=MAILREL/=\"$(MAILREL)\"/" \ + ./www/release.in \ + ) > ./www/release.php + +#to check if git find difference +PUB=mailleurXXXXX +NEWGIT = $(shell cd mailleur ; git diff --exit-code > /dev/null; echo $$?) +#-------------------------------------------------------------------- diff --git a/lib/subrou.d.29728 b/lib/subrou.d.29728 new file mode 100644 index 0000000..e69de29