From 267b48ab4a74efb9fcf1c0f4121b4ffcd2cb8e8c Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Tue, 5 Nov 2024 09:50:00 +0100 Subject: [PATCH 1/5] Fixes #39: Installation broken on Fedora Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- static/install-opentofu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/install-opentofu.sh b/static/install-opentofu.sh index 9c851ef..06da5ed 100755 --- a/static/install-opentofu.sh +++ b/static/install-opentofu.sh @@ -740,7 +740,7 @@ install_standalone() { if [ "${OPENTOFU_VERSION}" = "latest" ]; then log_info "Determining latest OpenTofu version..." - OPENTOFU_VERSION=$(download_file "https://api.github.com/repos/opentofu/opentofu/releases/latest" - | grep "tag_name" | sed -e 's/.*tag_name": "v//' -e 's/".*//') + OPENTOFU_VERSION=$(download_file "https://api.github.com/repos/opentofu/opentofu/releases/latest" - | grep "tag_name" | sed -e 's/.*tag_name":\s*"v//' -e 's/".*//') if [ -z "${OPENTOFU_VERSION}" ]; then log_error "Failed to obtain the latest release from the GitHub API. Try passing --opentofu-version to specify a version." return "${TOFU_INSTALL_EXIT_CODE_INSTALL_FAILED}" From 90de551378f297ca5276cfde0b65e6d9998ab47f Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:05:24 +0100 Subject: [PATCH 2/5] Removing development tools groupinstall Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- tests/linux/in-container/methods/brew.sh | 6 +++--- tests/linux/in-container/test-helper.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/linux/in-container/methods/brew.sh b/tests/linux/in-container/methods/brew.sh index dbe6063..7069365 100755 --- a/tests/linux/in-container/methods/brew.sh +++ b/tests/linux/in-container/methods/brew.sh @@ -5,7 +5,7 @@ case "$DISTRO" in apt-get install -y git build-essential gcc procps curl file bash ;; ubuntu) - apt-get install -y git build-essential gcc procps curl file bash + apt-get install -y git build-essential gcc procps curl file bash ;; alpine) #apk add git gcc bash curl ruby gcompat @@ -13,8 +13,8 @@ case "$DISTRO" in exit 0 ;; fedora | rocky) - yum install -y procps-ng curl file git gcc bash - yum groupinstall -y 'Development Tools' + dnf install -y procps-ng curl file git gcc bash + #dnf group install -y 'Development Tools' ;; opensuse) zypper install -y file git gcc tar bash ruby gzip diff --git a/tests/linux/in-container/test-helper.sh b/tests/linux/in-container/test-helper.sh index da09002..6203019 100755 --- a/tests/linux/in-container/test-helper.sh +++ b/tests/linux/in-container/test-helper.sh @@ -36,5 +36,6 @@ if [ -n "${INIT}" ] && [ "${INIT}" != "-" ]; then exec ${INIT} else echo "Setup complete." + set -x exec /tests/linux/in-container/run-test.sh fi From d72ac48b0122fa73f48d05a74d806ff71ae4a6ea Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:07:26 +0100 Subject: [PATCH 3/5] Cleanup Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- tests/linux/in-container/methods/brew.sh | 1 - tests/linux/in-container/test-helper.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/linux/in-container/methods/brew.sh b/tests/linux/in-container/methods/brew.sh index 7069365..4e06b9e 100755 --- a/tests/linux/in-container/methods/brew.sh +++ b/tests/linux/in-container/methods/brew.sh @@ -14,7 +14,6 @@ case "$DISTRO" in ;; fedora | rocky) dnf install -y procps-ng curl file git gcc bash - #dnf group install -y 'Development Tools' ;; opensuse) zypper install -y file git gcc tar bash ruby gzip diff --git a/tests/linux/in-container/test-helper.sh b/tests/linux/in-container/test-helper.sh index 6203019..da09002 100755 --- a/tests/linux/in-container/test-helper.sh +++ b/tests/linux/in-container/test-helper.sh @@ -36,6 +36,5 @@ if [ -n "${INIT}" ] && [ "${INIT}" != "-" ]; then exec ${INIT} else echo "Setup complete." - set -x exec /tests/linux/in-container/run-test.sh fi From ca25661db3ca6dc617c4fadb340f89e3941c557b Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:08:29 +0100 Subject: [PATCH 4/5] Removed space support Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- static/install-opentofu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/install-opentofu.sh b/static/install-opentofu.sh index 06da5ed..0279518 100755 --- a/static/install-opentofu.sh +++ b/static/install-opentofu.sh @@ -740,7 +740,7 @@ install_standalone() { if [ "${OPENTOFU_VERSION}" = "latest" ]; then log_info "Determining latest OpenTofu version..." - OPENTOFU_VERSION=$(download_file "https://api.github.com/repos/opentofu/opentofu/releases/latest" - | grep "tag_name" | sed -e 's/.*tag_name":\s*"v//' -e 's/".*//') + OPENTOFU_VERSION=$(download_file "https://api.github.com/repos/opentofu/opentofu/releases/latest" - | grep "tag_name" | sed -e 's/.*tag_name":"v//' -e 's/".*//') if [ -z "${OPENTOFU_VERSION}" ]; then log_error "Failed to obtain the latest release from the GitHub API. Try passing --opentofu-version to specify a version." return "${TOFU_INSTALL_EXIT_CODE_INSTALL_FAILED}" From b2c15acd35f55edc461c8620cdd1900d86c957b9 Mon Sep 17 00:00:00 2001 From: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:12:36 +0100 Subject: [PATCH 5/5] Fallback space handling Signed-off-by: AbstractionFactory <179820029+abstractionfactory@users.noreply.github.com> --- static/install-opentofu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/install-opentofu.sh b/static/install-opentofu.sh index 0279518..3f45231 100755 --- a/static/install-opentofu.sh +++ b/static/install-opentofu.sh @@ -740,7 +740,7 @@ install_standalone() { if [ "${OPENTOFU_VERSION}" = "latest" ]; then log_info "Determining latest OpenTofu version..." - OPENTOFU_VERSION=$(download_file "https://api.github.com/repos/opentofu/opentofu/releases/latest" - | grep "tag_name" | sed -e 's/.*tag_name":"v//' -e 's/".*//') + OPENTOFU_VERSION=$(download_file "https://api.github.com/repos/opentofu/opentofu/releases/latest" - | grep "tag_name" | sed -e 's/.*tag_name":"v//' -e 's/.*tag_name": "v//' -e 's/".*//') if [ -z "${OPENTOFU_VERSION}" ]; then log_error "Failed to obtain the latest release from the GitHub API. Try passing --opentofu-version to specify a version." return "${TOFU_INSTALL_EXIT_CODE_INSTALL_FAILED}"