From e753a863253ac28df074ff3e0b44f2eba1d1f55a Mon Sep 17 00:00:00 2001 From: ngn Date: Sun, 18 Aug 2024 21:49:31 +0300 Subject: [PATCH] new: MTSC_VERSION variable --- Makefile | 4 ++-- matter-base/Makefile | 2 +- matter-chroot/Makefile | 2 +- matter-iso/Makefile | 2 +- mp-build/Makefile | 2 +- mp-build/scripts/mp-build.sh | 2 +- mp-pool/Makefile | 2 +- mp-pool/scripts/mp-pool.sh | 2 +- mtsc-common/Makefile | 6 +++++- mtsc-common/common.sh | 5 +++++ 10 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index e0cf900..f515741 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ SUBDIRS := $(wildcard */.) -prefix = /usr +VERSION = 24.04 install: @for dir in $(SUBDIRS) ; do \ - $(MAKE) -C "$$dir" install ; \ + $(MAKE) -C "$$dir" VERSION=\"$(VERSION)\" install ; \ done uninstall: diff --git a/matter-base/Makefile b/matter-base/Makefile index 197bf65..48a1790 100644 --- a/matter-base/Makefile +++ b/matter-base/Makefile @@ -1,7 +1,7 @@ PREFIX = /usr install: - install -m755 "main.sh" $(DESTDIR)/$(PREFIX)/bin/matter-base + install -Dm755 "main.sh" $(DESTDIR)/$(PREFIX)/bin/matter-base uninstall: rm $(DESTDIR)/$(PREFIX)/lib/matter-base diff --git a/matter-chroot/Makefile b/matter-chroot/Makefile index 59d1ab5..8cbb796 100644 --- a/matter-chroot/Makefile +++ b/matter-chroot/Makefile @@ -1,7 +1,7 @@ PREFIX = /usr install: - install -m755 "main.sh" $(DESTDIR)/$(PREFIX)/bin/matter-chroot + install -Dm755 "main.sh" $(DESTDIR)/$(PREFIX)/bin/matter-chroot uninstall: rm $(DESTDIR)/$(PREFIX)/lib/matter-chroot diff --git a/matter-iso/Makefile b/matter-iso/Makefile index ae0aa6d..e2d104f 100644 --- a/matter-iso/Makefile +++ b/matter-iso/Makefile @@ -1,7 +1,7 @@ PREFIX = /usr install: - install -m755 "main.sh" $(DESTDIR)/$(PREFIX)/bin/matter-iso + install -Dm755 "main.sh" $(DESTDIR)/$(PREFIX)/bin/matter-iso uninstall: rm $(DESTDIR)/$(PREFIX)/lib/matter-iso diff --git a/mp-build/Makefile b/mp-build/Makefile index e83ec97..e8bb627 100644 --- a/mp-build/Makefile +++ b/mp-build/Makefile @@ -4,7 +4,7 @@ PREFIX = /usr install: @for s in $(SCRIPTS) ; do \ echo "installing script: $$s" ; \ - install -m755 "scripts/$$s.sh" $(DESTDIR)/$(PREFIX)/bin/$$s ; \ + install -Dm755 "scripts/$$s.sh" $(DESTDIR)/$(PREFIX)/bin/$$s ; \ done uninstall: diff --git a/mp-build/scripts/mp-build.sh b/mp-build/scripts/mp-build.sh index 1e8b1c4..c976fac 100755 --- a/mp-build/scripts/mp-build.sh +++ b/mp-build/scripts/mp-build.sh @@ -83,7 +83,7 @@ check_hash() { # prints the help info help_cmd() { - info "MatterLinux package build script" + info "MatterLinux package build script (mtsc ${MTSC_VERSION})" # sourced from mtsc-common info "Usage: ${0} [package directory]" info "Options:" echo_color " $BOLD--no-depend$RESET: don't check depends" diff --git a/mp-pool/Makefile b/mp-pool/Makefile index e83ec97..e8bb627 100644 --- a/mp-pool/Makefile +++ b/mp-pool/Makefile @@ -4,7 +4,7 @@ PREFIX = /usr install: @for s in $(SCRIPTS) ; do \ echo "installing script: $$s" ; \ - install -m755 "scripts/$$s.sh" $(DESTDIR)/$(PREFIX)/bin/$$s ; \ + install -Dm755 "scripts/$$s.sh" $(DESTDIR)/$(PREFIX)/bin/$$s ; \ done uninstall: diff --git a/mp-pool/scripts/mp-pool.sh b/mp-pool/scripts/mp-pool.sh index cecf2f5..57f2010 100755 --- a/mp-pool/scripts/mp-pool.sh +++ b/mp-pool/scripts/mp-pool.sh @@ -35,7 +35,7 @@ fi #################### # prints the help info help_cmd() { - info "MatterLinux pool build script" + info "MatterLinux pool build script (mtsc ${MTSC_VERSION})" # sourced from mtsc-common info "Usage: ${0} [pool directory] " info "Options:" echo_color " $BOLD--skip-fail$RESET: skip if a package build fails" diff --git a/mtsc-common/Makefile b/mtsc-common/Makefile index 312d928..c693413 100644 --- a/mtsc-common/Makefile +++ b/mtsc-common/Makefile @@ -1,7 +1,11 @@ PREFIX = /usr +# set by mtsc Makefile +VERSION = 0 + install: - install -m755 "common.sh" $(DESTDIR)/$(PREFIX)/lib/mtsc-common.sh + install -Dm755 "common.sh" $(DESTDIR)/$(PREFIX)/lib/mtsc-common.sh + sed 's/MTSC_VERSION_HOLDER/$(VERSION)/g' -i $(DESTDIR)/$(PREFIX)/lib/mtsc-common.sh uninstall: rm $(DESTDIR)/$(PREFIX)/lib/mtsc-common.sh diff --git a/mtsc-common/common.sh b/mtsc-common/common.sh index e0053dd..9c2f804 100755 --- a/mtsc-common/common.sh +++ b/mtsc-common/common.sh @@ -24,6 +24,11 @@ if [ $? -eq 1 ]; then exit 1 fi +############# +## version ## +############# +MTSC_VERSION="MTSC_VERSION_HOLDER" + ############################ ## logging functions/vars ## ############################