Package Details: tfenv 3.0.0-2

Git Clone URL: https://aur.archlinux.org/tfenv.git (read-only, click to copy)
Package Base: tfenv
Description: Terraform version manager inspired by rbenv
Upstream URL: https://github.com/tfutils/tfenv
Keywords: terraform
Licenses: MIT
Conflicts: terraform
Provides: terraform, tfenv
Submitter: zephrax
Maintainer: T4cC0re (gmy, Daklon)
Last Packager: Daklon
Votes: 16
Popularity: 0.000064
First Submitted: 2018-02-26 14:36 (UTC)
Last Updated: 2023-05-14 00:20 (UTC)

Required by (18)

Sources (1)

Pinned Comments

T4cC0re commented on 2020-04-20 17:53 (UTC)

tfenv 2.0!

Also some under the hood improvements to the way this is packaged

  • Versions and the version file remain in /var/lib/tfenv/
  • Actual application is now installed to /opt/tfenv
  • Symlinks to /usr/bin are provided for both tfenv and terraform
  • Once you add your user to the tfenv group, you can manage versions as a non-root user

Latest Comments

« First ‹ Previous 1 2 3 Next › Last »

ribugent commented on 2022-03-10 07:19 (UTC)

Hi,

I have the same problem as @MigueldeCarvalho.

It seems that the 2.2.3 release has introduced a change incompatible with the current PKGBUILD which patches the code to install terraform versions and set the version file in /var/lib/tfenv/. The current patch does not work at all because we're seeing tfenv trying to make changes in /opt/tfenv/

Here's my patch to get everything working again

diff --git a/PKGBUILD b/PKGBUILD
index 93e9f58..2b8dc96 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
 # Maintainer: Oliver "OJFord" Ford <dev.aur@ojford.com>
 pkgname=tfenv
 pkgver=2.2.3
-pkgrel=1
+pkgrel=2
 epoch=
 pkgdesc="Terraform version manager inspired by rbenv"
 arch=("x86_64")
@@ -28,6 +28,7 @@ package() {
        mkdir -p "${pkgdir}/opt/tfenv/bin"

        # This patches tfenv to use a separate dir for versions and the default version
+       sed -i 's:${TFENV_CONFIG_DIR}/version:/var/lib/tfenv/version:g' libexec/tfenv-*
        sed -i 's:${TFENV_ROOT}/version:/var/lib/tfenv/version:g' libexec/tfenv-*

        ln -s "/opt/tfenv/bin/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"

Hope this helps

MigueldeCarvalho commented on 2022-03-08 11:31 (UTC)

Hey, I am getting this error with new v2.2.3

version '1.1.3' is not installed (set by /home/mike/Documents/Customers/PL/pupil-cloud-terraform/.terraform-version). Installing now as TFENV_AUTO_INSTALL==true
Installing Terraform v1.1.3
Downloading release tarball from https://releases.hashicorp.com/terraform/1.1.3/terraform_1.1.3_linux_amd64.zip
####################################################################################################################################################################################### 100.0%
Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.1.3/terraform_1.1.3_SHA256SUMS
No keybase install found, skipping OpenPGP signature verification
mkdir: cannot create directory ‘/opt/tfenv/versions’: Permission denied
Failed to make directory /opt/tfenv/versions/1.1.3
/opt/tfenv/libexec/tfenv-exec: line 105: /opt/tfenv/versions/1.1.3/terraform: No such file or directory

Thanks

OJFord commented on 2022-03-05 13:20 (UTC)

Hi, I'd be happy to help if you're looking for an extra maintainer. (I flagged out of date last month and have some open PRs on tfenv, so have some interest in/awareness of new releases.)

DenisBY commented on 2021-04-30 09:26 (UTC)

Please update to 2.2.1 because of this issue https://github.com/tfutils/tfenv/issues/259

T4cC0re commented on 2021-02-15 16:41 (UTC)

Hey there, sorry for the delay in getting this updated. All up2date now :)

T4cC0re commented on 2020-04-20 17:53 (UTC)

tfenv 2.0!

Also some under the hood improvements to the way this is packaged

  • Versions and the version file remain in /var/lib/tfenv/
  • Actual application is now installed to /opt/tfenv
  • Symlinks to /usr/bin are provided for both tfenv and terraform
  • Once you add your user to the tfenv group, you can manage versions as a non-root user

T4cC0re commented on 2019-12-07 13:32 (UTC)

@knotsies: You got it :) Just pushed 1.0.2-4

FYI in general: I know there is a tfenv 2.x, but that is not a stable release yet. I will not update this package with a non-stable release.

knotsies commented on 2019-12-07 13:26 (UTC)

Hello! Thanks for adding this package to the AUR!

tfenv appears to use unzip when installing a new version:

/usr/local/lib/tfenv/libexec/tfenv-install: line 177: unzip: command not found
tfenv: tfenv-install: [ERROR] Tarball unzip failed

Can unzip be added as a dependency of this package?

T4cC0re commented on 2019-09-11 14:23 (UTC)

Sorry it took so long. Applied the suggestion by WhiteAnthrax. @WhiteAnthrax if you are interested I would like to make you a co-maintainer. You seem to be more active than me :)

WhiteAnthrax commented on 2019-09-02 06:46 (UTC)

Oh.. sorry % diff -u PKGBUILD.orig PKGBUILD

--- PKGBUILD.orig   2019-09-02 14:42:42.000000000 +0900
+++ PKGBUILD    2019-09-02 15:46:12.305817135 +0900
@@ -2,7 +2,7 @@
 # Maintainer: Hendrik "T4cC0re" Meyer <aur@t4cc0.re>
 pkgname=tfenv
 pkgver=1.0.1
-pkgrel=2
+pkgrel=3
 epoch=
 pkgdesc="Terraform version manager inspired by rbenv"
 arch=("x86_64")
@@ -20,14 +20,16 @@
 package() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    mkdir -p "${pkgdir}/usr/local/bin"
-   mkdir -p "${pkgdir}/usr/local/libexec"
+   mkdir -p "${pkgdir}/usr/local/lib/tfenv/libexec"
    echo $srcdir
    ls -lah
+  sed -i 's:TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/.." \&\& pwd)":TFENV_ROOT="$(cd "$(dirname "$(readlink_f "${0}")")/../lib/tfenv" \&\& pwd)":' bin/tfenv
    install -m755 "bin/${pkgname}" "${pkgdir}/usr/local/bin/${pkgname}"
    install -m755 "bin/terraform" "${pkgdir}/usr/local/bin/terraform"
-   for i in `ls ${srcdir}/${pkgname}/libexec/`; do
-       install -m755 "${srcdir}/${pkgname}/libexec/$i" "${pkgdir}/usr/local/libexec/$i"
+   for i in `ls ${srcdir}/${pkgname}-${pkgver}/libexec/`; do
+       install -m755 "${srcdir}/${pkgname}-${pkgver}/libexec/$i" "${pkgdir}/usr/local/lib/tfenv/libexec/$i"
    done
    chmod +x ${pkgdir}/usr/local/bin/${pkgname}
+  install -m644 "${srcdir}/${pkgname}-${pkgver}/CHANGELOG.md" "${pkgdir}/usr/local/lib/tfenv/"
 }
 sha512sums=(9ec96f67f6c25d0bb93fa880da6e1fdd74d6a5f930b29c45779a878ddc547eb10d2e6bacbbd64ac9a2a11b90b022fff87cd861a20eb3a412e39812e26c92741f)