From 3a758ba49344ba503716e0fddcee9022c9d62755 Mon Sep 17 00:00:00 2001 From: V_Galaxy Date: Sat, 23 Dec 2023 20:56:18 +0800 Subject: [PATCH] fix: double quotes to avoid spaces in grep for validating release (#310) --- .github/workflows/validate-release.yml | 6 +++--- dist/validate-release.sh | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/validate-release.yml b/.github/workflows/validate-release.yml index d2d90a222..221ace5da 100644 --- a/.github/workflows/validate-release.yml +++ b/.github/workflows/validate-release.yml @@ -123,14 +123,14 @@ jobs: fi # 4.3: ensure doesn't contains ASF CATEGORY X License dependencies in LICENSE and NOTICE files - COUNT=$(grep -E $CATEGORY_X LICENSE NOTICE | wc -l) + COUNT=$(grep -E "$CATEGORY_X" LICENSE NOTICE | wc -l) if [[ $COUNT -ne 0 ]]; then grep -E "$CATEGORY_X" LICENSE NOTICE echo "The package $i shouldn't include invalid ASF category X dependencies, but get $COUNT" && exit 1 fi # 4.4: ensure doesn't contains ASF CATEGORY B License dependencies in LICENSE and NOTICE files - COUNT=$(grep -E $CATEGORY_B LICENSE NOTICE | wc -l) + COUNT=$(grep -E "$CATEGORY_B" LICENSE NOTICE | wc -l) if [[ $COUNT -ne 0 ]]; then grep -E "$CATEGORY_B" LICENSE NOTICE echo "The package $i shouldn't include invalid ASF category B dependencies, but get $COUNT" && exit 1 @@ -267,7 +267,7 @@ jobs: fi # 7.3: ensure doesn't contains ASF CATEGORY X License dependencies in LICENSE/NOTICE and licenses/* files - COUNT=$(grep -r -E $CATEGORY_X LICENSE NOTICE licenses | wc -l) + COUNT=$(grep -r -E "$CATEGORY_X" LICENSE NOTICE licenses | wc -l) if [[ $COUNT -ne 0 ]]; then grep -r -E "$CATEGORY_X" LICENSE NOTICE licenses echo "The package $i shouldn't include invalid ASF category X dependencies, but get $COUNT" && exit 1 diff --git a/dist/validate-release.sh b/dist/validate-release.sh index 667061264..2181058c5 100755 --- a/dist/validate-release.sh +++ b/dist/validate-release.sh @@ -105,14 +105,14 @@ for i in *src.tar.gz; do fi # 4.3: ensure doesn't contains ASF CATEGORY X License dependencies in LICENSE and NOTICE files - COUNT=$(grep -E $CATEGORY_X LICENSE NOTICE | wc -l) + COUNT=$(grep -E "$CATEGORY_X" LICENSE NOTICE | wc -l) if [[ $COUNT -ne 0 ]]; then grep -E "$CATEGORY_X" LICENSE NOTICE echo "The package $i shouldn't include invalid ASF category X dependencies, but get $COUNT" && exit 1 fi # 4.4: ensure doesn't contains ASF CATEGORY B License dependencies in LICENSE and NOTICE files - COUNT=$(grep -E $CATEGORY_B LICENSE NOTICE | wc -l) + COUNT=$(grep -E "$CATEGORY_B" LICENSE NOTICE | wc -l) if [[ $COUNT -ne 0 ]]; then grep -E "$CATEGORY_B" LICENSE NOTICE echo "The package $i shouldn't include invalid ASF category B dependencies, but get $COUNT" && exit 1 @@ -211,8 +211,8 @@ bin/stop-hugegraph.sh || exit popd || exit # clear source packages -rm -rf ./*src* -ls -lh +#rm -rf ./*src* +#ls -lh #################################### # Step 7: Validate Binary Packages # @@ -252,7 +252,7 @@ for i in *.tar.gz; do fi # 7.3: ensure doesn't contains ASF CATEGORY X License dependencies in LICENSE/NOTICE and licenses/* files - COUNT=$(grep -r -E $CATEGORY_X LICENSE NOTICE licenses | wc -l) + COUNT=$(grep -r -E "$CATEGORY_X" LICENSE NOTICE licenses | wc -l) if [[ $COUNT -ne 0 ]]; then grep -r -E "$CATEGORY_X" LICENSE NOTICE licenses echo "The package $i shouldn't include invalid ASF category X dependencies, but get $COUNT" && exit 1