Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Ismael Luceno (c60a4b6e1138d2bc8833ee50dc135aa5c4b67773)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Ismael Luceno (c60a4b6e1138d2bc8833ee50dc135aa5c4b67773)
  • Date: Wed, 8 Sep 2021 19:56:06 +0000

GIT changes to master sorcery by Ismael Luceno <ismael AT sourcemage.org>:

ChangeLog | 3 +++
Makefile | 22 ++++++++--------------
bump.awk | 20 ++++++++++++++++++++
3 files changed, 31 insertions(+), 14 deletions(-)

New commits:
commit c60a4b6e1138d2bc8833ee50dc135aa5c4b67773
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

Makefile: Unify version-bump targets

Just detect from the output of git-describe if it's at a version tag and
update accordingly.

Use the new target on devinst.

diff --git a/ChangeLog b/ChangeLog
index 1955b99..b739d6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2021-09-08 Ismael Luceno <ismael AT sourcemage.org>
+ * Makefile: unified version bump target + make devinst dep on it
+
2021-02-26 Thomas Orgis <sobukus AT sourcemage.org>
* Makefile: added devinst target to mark installs from git checkout

diff --git a/Makefile b/Makefile
index 35a9437..c95a610 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+AWK ?= awk
+
.PHONY: help
help:
@awk 'sub(/^#HELP: ?/, "")' $(MAKEFILE_LIST) $(.MAKE.MAKEFILES)
@@ -19,24 +21,16 @@ $(release): $(ts-scm)
release: $(release)

#HELP: bump - Bump version
-.PHONY: bump bump-stable bump-devel
-bump-stable:
- git describe --tags | >etc/sorcery/version \
- awk -F'[^0-9]' -vOFS=. '{++$$NF;for(i=1;i<NF;i++)$$i=$$(i+1)}NF--'
-
-bump-devel:
- date -u +%Y%m%d > etc/sorcery/version
-
-bump: bump-$(BRANCH)
+.PHONY: bump
+bump:
+ git describe --tags | >etc/sorcery/version ${AWK} -f bump.awk

-devinst: install
- date +%Y%m%d | tr '\n' - > /etc/sorcery/version
- git show --oneline | head -n 1 | cut -f 1 -d ' ' >>
/etc/sorcery/version
+devinst: bump install

#HELP: install - Install sorcery
-#HELP: devinst - Install with version vom active branch
+#HELP: devinst - Install with version from active branch
#HELP: uninstall - Uninstall sorcery
#HELP: convert - Convert from Pre 0.8.x grimoire to new codex format
-script-targets = install uninstall convert
+script-targets = install devinst uninstall convert
.PHONY: $(script-targets)
$(script-targets):; ./$@
diff --git a/bump.awk b/bump.awk
new file mode 100644
index 0000000..ad04bde
--- /dev/null
+++ b/bump.awk
@@ -0,0 +1,20 @@
+BEGIN {
+ FS="[^0-9]"
+ OFS="."
+}
+
+# bump stable
+/^v/ && !/-[1-9][0-9]*-g[0-9a-f]+$/ {
+ ++$NF
+ for (i = 1; i < NF; i++)
+ $i = $(i+1)
+ --NF
+ print
+ exit
+}
+
+# bump snapshot
+{
+ sub(/.*-g/, strftime("%Y%m%d-g", systime(), 1))
+ print
+}



  • [SM-Commit] GIT changes to master sorcery by Ismael Luceno (c60a4b6e1138d2bc8833ee50dc135aa5c4b67773), Ismael Luceno, 09/08/2021

Archive powered by MHonArc 2.6.24.

Top of Page