From 249c3b9c60b059095fe6a0656b816c84a96dcc4e Mon Sep 17 00:00:00 2001 From: zhanchengbin Date: Wed, 7 Sep 2022 15:01:19 +0800 Subject: [PATCH] SC2081: [ .. ] can't match globs. Use [[ .. ]] or grep. Shellcheck check out a problem. Signed-off-by: zhanchengbin (cherry picked from commit c1f2a29669edfa6d43800deece8bec8205447fc2) --- ...SC2081-can-t-match-globs-Use-or-grep.patch | 34 +++++++++++++++++++ glusterfs.spec | 9 +++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 0001-SC2081-can-t-match-globs-Use-or-grep.patch diff --git a/0001-SC2081-can-t-match-globs-Use-or-grep.patch b/0001-SC2081-can-t-match-globs-Use-or-grep.patch new file mode 100644 index 0000000..833b91b --- /dev/null +++ b/0001-SC2081-can-t-match-globs-Use-or-grep.patch @@ -0,0 +1,34 @@ +From 396f52a60bbe5eba0075b1658d84e46cbf7461ab Mon Sep 17 00:00:00 2001 +From: zhanchengbin +Date: Thu, 13 Oct 2022 10:34:52 +0800 +Subject: [PATCH] SC2081: [ .. ] can't match globs. Use [[ .. ]] or grep. + +Shellcheck check out a problem. + +Signed-off-by: zhanchengbin +--- + .../add-brick/post/disabled-quota-root-xattr-heal.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh +index ca17a90..969d6fc 100755 +--- a/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh ++++ b/extras/hook-scripts/add-brick/post/disabled-quota-root-xattr-heal.sh +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + ##--------------------------------------------------------------------------- + ## This script updates the 'limit-set' xattr on the newly added node. Please +@@ -106,7 +106,7 @@ ENABLED_STATE_1="${GLUSTERD_WORKDIR}/hooks/${VERSION}/${VOLUME_OP}/" + ENABLED_STATE_2="post/${ENABLED_NAME_PREFIX}${VOL_NAME}-${ENABLED_NAME}" + ENABLED_STATE="${ENABLED_STATE_1}${ENABLED_STATE_2}" + +-if [ "${THIS_SCRIPT}" != *"${VOL_NAME}"* ]; then ++if [[ "${THIS_SCRIPT}" != *"${VOL_NAME}"* ]]; then + exit 0 + fi + +-- +2.37.3 + diff --git a/glusterfs.spec b/glusterfs.spec index e924211..b5c4ebc 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -224,7 +224,7 @@ Summary: Distributed File System Name: glusterfs Version: 10.0 -Release: 4 +Release: 5 License: GPLv2 or LGPLv3+ URL: http://docs.gluster.org/ %if ( 0%{_for_fedora_koji_builds} ) @@ -236,6 +236,8 @@ Source8: glusterfsd.init %else Source0: https://download.gluster.org/pub/gluster/glusterfs/10/10.0/glusterfs-10.0.tar.gz %endif + +Patch1: 0001-SC2081-can-t-match-globs-Use-or-grep.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: rpcgen gperftools-devel libunwind-devel @@ -764,7 +766,7 @@ GlusterFS Events %endif %prep -%setup -q -n %{name}-%{version}%{?prereltag} +%autosetup -n %{name}-%{version}%{?prereltag} -p1 %if ( ! %{_usepython3} ) echo "fixing python shebangs..." for f in api events extras geo-replication libglusterfs tools xlators; do @@ -1516,6 +1518,9 @@ exit 0 %endif %changelog +* Wed Sep 7 2022 zhanchengbin - 10.0-5 +- SC2081: [ .. ] can't match globs. Use [[ .. ]] or grep. + * Fri Jan 28 2022 imxcc - 10.0-4 - tcmalloc issues -- Gitee