From 7988ec6d7640e9dc89025f2229299cbffbc4a58d Mon Sep 17 00:00:00 2001 From: Pat Date: Tue, 18 Oct 2022 10:09:08 +0100 Subject: [PATCH] packaging: handle parameters separate from command for word splitting (#6224) Signed-off-by: Patrick Stephens Signed-off-by: Patrick Stephens Signed-off-by: root --- packaging/server/publish-all.sh | 21 +++++++++++---------- packaging/update-repos.sh | 7 ++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/packaging/server/publish-all.sh b/packaging/server/publish-all.sh index 78e2e2fbd48..b8e3ecdc441 100755 --- a/packaging/server/publish-all.sh +++ b/packaging/server/publish-all.sh @@ -26,6 +26,7 @@ fi # Handle Ubuntu 18/22 differences - no support on Ubuntu 20 CREATE_REPO_CMD=${CREATE_REPO_CMD:-} +CREATE_REPO_ARGS=${CREATE_REPO_ARGS:--dvp} # Assume if set we want to use it if [[ -n "$CREATE_REPO_CMD" ]]; then @@ -46,44 +47,44 @@ if [[ -d "$SOURCE_DIR/amazonlinux/2022/" ]]; then echo "Publishing AmazonLinux 2022" mkdir -p /var/www/apt.fluentbit.io/amazonlinux/2022/x86_64 /var/www/apt.fluentbit.io/amazonlinux/2022/aarch64 find "$SOURCE_DIR/amazonlinux/2022" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2022/x86_64" \; - "$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2022/x86_64" + "$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2022/x86_64" find "$SOURCE_DIR/amazonlinux/2022" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2022/aarch64" \; - "$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2022/aarch64" + "$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2022/aarch64" fi # Amazon Linux 2 echo "Publishing AmazonLinux 2" find "$SOURCE_DIR/amazonlinux/2" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64" \; -"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64" +"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2/aarch64" find "$SOURCE_DIR/amazonlinux/2" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/amazonlinux/2/x86_64" \; -"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/amazonlinux/2/x86_64" +"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/amazonlinux/2/x86_64" # Centos 7 echo "Publishing Centos 7" find "$SOURCE_DIR/centos/7/" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/7/aarch64" \; -"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/7/aarch64" +"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/7/aarch64" find "$SOURCE_DIR/centos/7/" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/7/x86_64" \; -"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/7/x86_64" +"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/7/x86_64" # Centos 8 echo "Publishing Centos 8" find "$SOURCE_DIR/centos/8/" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/8/aarch64" \; -"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/8/aarch64" +"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/8/aarch64" find "$SOURCE_DIR/centos/8/" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/8/x86_64" \; -"$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/8/x86_64" +"$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/8/x86_64" # Centos 9 if [[ -d "$SOURCE_DIR/centos/9/" ]]; then echo "Publishing Centos 9" find "$SOURCE_DIR/centos/9/" -iname "*-bit-$VERSION-*aarch64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/9/aarch64" \; - "$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/9/aarch64" + "$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/9/aarch64" find "$SOURCE_DIR/centos/9/" -iname "*-bit-$VERSION-*x86_64*.rpm" -exec cp -fv {} "/var/www/apt.fluentbit.io/centos/9/x86_64" \; - "$CREATE_REPO_CMD" "/var/www/apt.fluentbit.io/centos/9/x86_64" + "$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "/var/www/apt.fluentbit.io/centos/9/x86_64" fi # Debian 10 Buster diff --git a/packaging/update-repos.sh b/packaging/update-repos.sh index 597a1e9155f..de5af41e658 100755 --- a/packaging/update-repos.sh +++ b/packaging/update-repos.sh @@ -17,16 +17,17 @@ fi # Handle Ubuntu 18/22 differences - no support on Ubuntu 20 CREATE_REPO_CMD=${CREATE_REPO_CMD:-} +CREATE_REPO_ARGS=${CREATE_REPO_ARGS:--dvp} # Assume if set we want to use it if [[ -n "$CREATE_REPO_CMD" ]]; then echo "Using $CREATE_REPO_CMD" elif command -v createrepo &> /dev/null; then echo "Found createrepo" - CREATE_REPO_CMD="createrepo -dvp" + CREATE_REPO_CMD="createrepo" elif command -v createrepo_c &> /dev/null; then echo "Found createrepo_c" - CREATE_REPO_CMD="createrepo_c -dvp" + CREATE_REPO_CMD="createrepo_c" else echo "Unable to find a command equivalent to createrepo" exit 1 @@ -44,7 +45,7 @@ for RPM_REPO in "${RPM_REPO_PATHS[@]}"; do find "$REPO_DIR" -name "*-bit-*.rpm" -exec rpm --define "_gpg_name $GPG_KEY" --addsign {} \; fi # Create full metadata for all RPMs in the directory - "$CREATE_REPO_CMD" "$REPO_DIR" + "$CREATE_REPO_CMD" "$CREATE_REPO_ARGS" "$REPO_DIR" # Set up repo info if [[ -n "${AWS_S3_BUCKET:-}" ]]; then