From f414f51d823cd96c1a65aafd0dfdba535b8b9e5e Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 31 Oct 2015 12:39:24 +0000 Subject: [PATCH] letsencrypt-auto for debian squeeze (fixes #1078). --- bootstrap/venv.sh | 2 +- letsencrypt-auto | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bootstrap/venv.sh b/bootstrap/venv.sh index da8177828..ff1a50c6c 100755 --- a/bootstrap/venv.sh +++ b/bootstrap/venv.sh @@ -13,7 +13,7 @@ VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"} # later steps, causing "ImportError: cannot import name unpack_url" if [ ! -d $VENV_PATH ] then - virtualenv --no-site-packages --python python2 $VENV_PATH + virtualenv --no-site-packages --python ${LE_PYTHON:-python2} $VENV_PATH fi . $VENV_PATH/bin/activate diff --git a/letsencrypt-auto b/letsencrypt-auto index bee183dac..dbece5eff 100755 --- a/letsencrypt-auto +++ b/letsencrypt-auto @@ -26,6 +26,13 @@ for arg in "$@" ; do fi done +if [ -f /etc/debian_version ] ; then + # squeeze needs Python 2.6, `python2` doesn't exist + if grep -q '^6\.0' /etc/debian_version ; then + LE_PYTHON=${LE_PYTHON:-python} + fi +fi + # virtualenv call is not idempotent: it overwrites pip upgraded in # later steps, causing "ImportError: cannot import name unpack_url" if [ ! -d $VENV_PATH ] @@ -67,9 +74,9 @@ then echo "Creating virtual environment..." if [ "$VERBOSE" = 1 ] ; then - virtualenv --no-site-packages --python python2 $VENV_PATH + virtualenv --no-site-packages --python ${LE_PYTHON:-python2} $VENV_PATH else - virtualenv --no-site-packages --python python2 $VENV_PATH > /dev/null + virtualenv --no-site-packages --python ${LE_PYTHON:-python2} $VENV_PATH > /dev/null fi fi