From 7b0a2f8e69e18b48b71a472b68a3bc807c1558b5 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 9 Jan 2023 23:26:30 +0300 Subject: [PATCH] Makefile, scstadmin/Makefile: Use git sha1 as the SCST revision git sha1 is a more convenient way to generate a revision than the number of commits. Also, remove svn repository support. --- Makefile | 7 +------ scstadmin/Makefile | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index a38b9b6f2..acd2415d7 100644 --- a/Makefile +++ b/Makefile @@ -70,12 +70,7 @@ EMULEX_DIR=emulex ISCSI_DIR=iscsi-scst -REVISION ?= $(shell if [ -e .svn ]; then \ - svn info | sed -n 's/^Revision:[[:blank:]]*/./p'; \ - elif [ -e .git ]; then \ - echo -n .; \ - git log | grep -c ^commit; \ - fi) +REVISION ?= $(shell if [ -e .git ]; then echo -n .; git rev-parse --short HEAD 2>/dev/null; fi) VERSION_WITHOUT_REVISION := $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)") VERSION := $(VERSION_WITHOUT_REVISION)$(REVISION) DEBIAN_REVISION=1.1 diff --git a/scstadmin/Makefile b/scstadmin/Makefile index 5d962ea96..a84c54192 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -2,12 +2,7 @@ ifndef PREFIX PREFIX=/usr/local endif -REVISION ?= $(shell if [ -e .svn ]; then \ - svn info | sed -n 's/^Revision:[[:blank:]]*/./p'; \ - elif [ -e .git ]; then \ - echo -n .; \ - git log | grep -c ^commit; \ - fi) +REVISION ?= $(shell if [ -e .git ]; then echo -n .; git rev-parse --short HEAD 2>/dev/null; fi) VERSION = $(shell echo -n "$$(sed -n 's/^[[:blank:]]*\$$VERSION[[:blank:]]*=[[:blank:]]*[\"'"'"']\([0-9.]*\)[\"'"'"'];$$/\1/p' scstadmin/scst-*/lib/SCST/SCST.pm)$(REVISION)") SCSTADMIN_DIR = $(shell if [ ! -h scstadmin ]; then \