From 21dec3881cb8aceafee93c19df078fc91bac0670 Mon Sep 17 00:00:00 2001 From: Eliran Sinvani Date: Mon, 30 Dec 2019 16:32:50 +0200 Subject: [PATCH] debian-reloc: rename buld product to the name specified in SCYLLA-VERSION-GEN When the product name is other than "scylla", the debian packaging scripts go over all files that starts with "scylla-" and change the prefix to be the actual product name. However, if there are no such files in the directory the script will fail since the renaming command will get the wildcard string instrad of an actual file name. This patch replaces the command with a command with an equivalent desired effect that only operates on files if there are any. Signed-off-by: Eliran Sinvani Message-Id: <20191230143250.18101-1-eliransin@scylladb.com> --- dist/debian/build_deb.sh | 6 +++--- dist/debian/python3/build_deb.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/debian/build_deb.sh b/dist/debian/build_deb.sh index 0ada062505..4e4051e854 100755 --- a/dist/debian/build_deb.sh +++ b/dist/debian/build_deb.sh @@ -132,9 +132,9 @@ ln -fv $RELOC_PKG_FULLPATH ../$PRODUCT-server_$SCYLLA_VERSION-$SCYLLA_RELEASE.or cp -al dist/debian/debian debian if [ "$PRODUCT" != "scylla" ]; then - for i in debian/scylla-*;do - mv $i ${i/scylla-/$PRODUCT-} - done + # rename all 'scylla-' prefixed artifacts in the debian folder to have the + # product name as a prefix + find debian -maxdepth 1 -name "scylla-*" -exec bash -c 'mv $1 ${1/scylla-/$PRODUCT-}' _ {} \; fi ln -fv dist/common/sysconfig/scylla-server debian/$PRODUCT-server.default REVISION="1" diff --git a/dist/debian/python3/build_deb.sh b/dist/debian/python3/build_deb.sh index e8fbf4e6d4..6aacb950e4 100755 --- a/dist/debian/python3/build_deb.sh +++ b/dist/debian/python3/build_deb.sh @@ -126,9 +126,9 @@ ln -fv $RELOC_PKG_FULLPATH ../$PRODUCT-python3_$SCYLLA_VERSION-$SCYLLA_RELEASE.o cp -al dist/debian/python3/debian debian if [ "$PRODUCT" != "scylla" ]; then - for i in debian/scylla-*;do - mv $i ${i/scylla-/$PRODUCT-} - done + # rename all 'scylla-' prefixed artifacts in the debian folder to have the + # product name as a prefix + find debian -maxdepth 1 -name "scylla-*" -exec bash -c 'mv $1 ${1/scylla-/$PRODUCT-}' _ {} \; fi REVISION="1" MUSTACHE_DIST="\"debian\": true, \"product\": \"$PRODUCT\", \"$PRODUCT\": true"