From 7c0540c55612e1839dd44771d61a3fc258b43ce8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 19 Nov 2018 04:25:36 +0000 Subject: [PATCH] Merge r7814:7819 from the 3.3.x branch git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7820 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- Makefile | 10 ++++++---- scripts/generate-release-archive | 8 +++++--- scripts/list-source-files | 4 ++-- scstadmin/Makefile | 10 ++++++---- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 377516aea..be84bef4b 100644 --- a/Makefile +++ b/Makefile @@ -54,11 +54,13 @@ EMULEX_DIR=emulex ISCSI_DIR=iscsi-scst -REVISION ?= $(shell if svn info >/dev/null 2>&1; \ - then svn info | sed -n 's/^Revision:[[:blank:]]*//p';\ - else git log | grep -c ^commit; \ +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) -VERSION := $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h).$(REVISION)") +VERSION := $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)$(REVISION)") DEBIAN_REVISION=1 help: diff --git a/scripts/generate-release-archive b/scripts/generate-release-archive index be6d04ebe..68698ad4e 100755 --- a/scripts/generate-release-archive +++ b/scripts/generate-release-archive @@ -20,7 +20,9 @@ if [ -z "$files" ]; then fi fi +result=../$name-$version.tar.bz2 +rm -f "${result}" for f in "${files[@]}"; do echo "$f"; done | \ - tar --owner=root --group=root --transform="s|^|$name-$version/|" \ - -cjf "$name-$version.tar.bz2" -T- -h && - ls -l "$name-$version.tar.bz2" + tar --owner=root --group=root --transform="s|^|$name-$version/|;s|^$name-$version/../scst/include/backport.h$|../scst/include/backport.h|;s|^$name-$version/scstadmin.sysfs$|scstadmin.sysfs|" \ + -cjf "${result}" -T- && + ls -l "${result}" diff --git a/scripts/list-source-files b/scripts/list-source-files index f1f3e2684..f4f00f80d 100755 --- a/scripts/list-source-files +++ b/scripts/list-source-files @@ -17,7 +17,7 @@ list_source_files() { grep -vE '^[D?]|^Performing|^$' | \ cut -c3- | \ while read -r a b c f; do - if [ -f "$f" ]; then + if [ -f "$f" -o -h "$f" ]; then echo "$a $b $c" >/dev/null echo "$f" fi @@ -39,7 +39,7 @@ list_source_files() { hg manifest fi else - echo "Not under source control: $1 ?" >&2 + ( cd "$d" && find -type f -o -type l | sed 's|^\./||' ) fi } diff --git a/scstadmin/Makefile b/scstadmin/Makefile index 79bfbf168..3369330d0 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -2,11 +2,13 @@ ifndef PREFIX PREFIX=/usr/local endif -REVISION ?= $(shell if svn info >/dev/null 2>&1; \ - then svn info | sed -n 's/^Revision:[[:blank:]]*//p';\ - else git log | grep -c ^commit; \ +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) -VERSION = $(shell echo -n "$$(sed -n 's/^[[:blank:]]*\$$VERSION[[:blank:]]*=[[:blank:]]*[\"'"'"']\([0-9.]*\)[\"'"'"'];$$/\1/p' scstadmin/scst-*/lib/SCST/SCST.pm).$(REVISION)") +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 \ rm -f scstadmin; \