From 5e50090bfdc480e96316f3bdd858f05c9d5719b8 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Mon, 22 Apr 2019 19:53:04 +0900 Subject: [PATCH] dist: merge product name parameter on single place When we add product name customization, we mistakenly defined the parameter on each package build script. Number of script is increasing since we recently added relocatable python3 package, we should merge it in single place. Also we should save the parameter on relocatable package, just like version-release parameters. So move the definition to SCYLLA-VERSION-GEN, save it to build/SCYLLA-PRODUCT-FILE then archive it to relocatable package. Signed-off-by: Takuya ASADA Message-Id: <20190422105304.23454-1-syuu@scylladb.com> --- SCYLLA-VERSION-GEN | 2 ++ dist/debian/build_deb.sh | 2 +- dist/redhat/build_rpm.sh | 2 +- reloc/build_rpm.sh | 2 +- scripts/create-relocatable-package.py | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SCYLLA-VERSION-GEN b/SCYLLA-VERSION-GEN index 753c982..12ef25c 100755 --- a/SCYLLA-VERSION-GEN +++ b/SCYLLA-VERSION-GEN @@ -1,5 +1,6 @@ #!/bin/sh +PRODUCT=scylla VERSION=666.development if test -f version @@ -17,3 +18,4 @@ echo "$SCYLLA_VERSION-$SCYLLA_RELEASE" mkdir -p build echo "$SCYLLA_VERSION" > build/SCYLLA-VERSION-FILE echo "$SCYLLA_RELEASE" > build/SCYLLA-RELEASE-FILE +echo "$PRODUCT" > build/SCYLLA-PRODUCT-FILE diff --git a/dist/debian/build_deb.sh b/dist/debian/build_deb.sh index dabd06c..0499221 100755 --- a/dist/debian/build_deb.sh +++ b/dist/debian/build_deb.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -PRODUCT=scylla +PRODUCT=$(cat SCYLLA-PRODUCT-FILE) . /etc/os-release print_usage() { diff --git a/dist/redhat/build_rpm.sh b/dist/redhat/build_rpm.sh index 61ff4fc..cd9a234 100755 --- a/dist/redhat/build_rpm.sh +++ b/dist/redhat/build_rpm.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -PRODUCT=scylla +PRODUCT=$(cat SCYLLA-PRODUCT-FILE) . /etc/os-release print_usage() { diff --git a/reloc/build_rpm.sh b/reloc/build_rpm.sh index f4b21b3..57e57a0 100755 --- a/reloc/build_rpm.sh +++ b/reloc/build_rpm.sh @@ -25,6 +25,6 @@ if [[ ! $OPTS =~ --reloc-pkg ]]; then OPTS="$OPTS --reloc-pkg $RELOC_PKG" fi mkdir -p build/redhat/scylla-package -tar -C build/redhat/scylla-package -xpf $RELOC_PKG SCYLLA-RELEASE-FILE SCYLLA-RELOCATABLE-FILE SCYLLA-VERSION-FILE dist/redhat +tar -C build/redhat/scylla-package -xpf $RELOC_PKG SCYLLA-RELEASE-FILE SCYLLA-RELOCATABLE-FILE SCYLLA-VERSION-FILE SCYLLA-PRODUCT-FILE dist/redhat cd build/redhat/scylla-package exec ./dist/redhat/build_rpm.sh $OPTS diff --git a/scripts/create-relocatable-package.py b/scripts/create-relocatable-package.py index bf22d4a..e64ff30 100755 --- a/scripts/create-relocatable-package.py +++ b/scripts/create-relocatable-package.py @@ -41,6 +41,7 @@ pathlib.Path('build/SCYLLA-RELOCATABLE-FILE').touch() ar.add('build/SCYLLA-RELOCATABLE-FILE', arcname='SCYLLA-RELOCATABLE-FILE') ar.add('build/SCYLLA-RELEASE-FILE', arcname='SCYLLA-RELEASE-FILE') ar.add('build/SCYLLA-VERSION-FILE', arcname='SCYLLA-VERSION-FILE') +ar.add('build/SCYLLA-PRODUCT-FILE', arcname='SCYLLA-PRODUCT-FILE') ar.add('dist') ar.add('target/scylla-jmx-1.0.jar', arcname='scylla-jmx-1.0.jar') ar.add('scripts/scylla-jmx', arcname='scylla-jmx')