pyenv / pyenv-installer

This tool is used to install `pyenv` and friends.
MIT License
3.96k stars 428 forks source link

Offline installer repo paths fail to clone #139

Closed bigpick closed 1 year ago

bigpick commented 1 year ago

Info

Running the ./download-pyenv-package.sh in the bin dir results in time outs when trying to run it unmodified.

I suspect its because the git://github.com/pyenv/pyenv-which-ext.git formats don't actually clone.

Workaround

Modify the GITHUB base vars and then also fixed the checkout invocations accordingly:

diff --git a/bin/download-pyenv-package.sh b/bin/download-pyenv-package.sh
index 03cc13c..5d34640 100755
--- a/bin/download-pyenv-package.sh
+++ b/bin/download-pyenv-package.sh
@@ -11,18 +11,18 @@ fi
 TMP_DIR=$(mktemp -d)

 if [ -n "${USE_HTTPS}" ]; then
-  GITHUB="https://github.com"
+  GITHUB="https://github.com/"
 else
-  GITHUB="git://github.com"
+  GITHUB="git@github.com:"
 fi

 # checkout to temporary directory.
-checkout "${GITHUB}/pyenv/pyenv.git"            "$TMP_DIR"
-checkout "${GITHUB}/pyenv/pyenv-doctor.git"     "$TMP_DIR"
-checkout "${GITHUB}/pyenv/pyenv-installer.git"  "$TMP_DIR"
-checkout "${GITHUB}/pyenv/pyenv-update.git"     "$TMP_DIR"
-checkout "${GITHUB}/pyenv/pyenv-virtualenv.git" "$TMP_DIR"
-checkout "${GITHUB}/pyenv/pyenv-which-ext.git"  "$TMP_DIR"
+checkout "${GITHUB}pyenv/pyenv.git"            "$TMP_DIR"
+checkout "${GITHUB}pyenv/pyenv-doctor.git"     "$TMP_DIR"
+checkout "${GITHUB}pyenv/pyenv-installer.git"  "$TMP_DIR"
+checkout "${GITHUB}pyenv/pyenv-update.git"     "$TMP_DIR"
+checkout "${GITHUB}pyenv/pyenv-virtualenv.git" "$TMP_DIR"
+checkout "${GITHUB}pyenv/pyenv-which-ext.git"  "$TMP_DIR"

 # create archive.
 tar -zcf "$PYENV_PACKAGE_ARCHIVE" -C "$TMP_DIR" .
bigpick commented 1 year ago

🤡 I didn't manage to see https://github.com/pyenv/pyenv-installer/pull/138 before I opened this (and #140)