Skip to content

Commit

Permalink
postinstall: don't try to install pip if it's already there
Browse files Browse the repository at this point in the history
On Debian 10, using our installer, `apt install bluecherry` step fails.
We still want a recent certbot on Debian 10, not the extra-old deb-packaged one.

++ wget --output-document=/tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
--2024-07-05 09:34:20--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 199.232.72.175, 2a04:4e42:52::175
Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|199.232.72.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2277800 (2.2M) [text/x-python]
Saving to: ‘/tmp/get-pip.py’

/tmp/get-pip.py                         100%[==============================================================================>]   2.17M  --.-KB/s    in 0.06s

2024-07-05 09:34:20 (34.0 MB/s) - ‘/tmp/get-pip.py’ saved [2277800/2277800]

++ python3 /tmp/get-pip.py
ERROR: This script does not work on Python 3.7. The minimum supported Python version is 3.8. Please use https://bootstrap.pypa.io/pip/3.7/get-pip.py instead.
++ return
dpkg: error processing package bluecherry (--configure):
 installed bluecherry package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.28-10+deb10u4) ...
Errors were encountered while processing:
 bluecherry
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • Loading branch information
andrey-utkin committed Jul 5, 2024
1 parent 43fb4c6 commit 78c0b56
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions misc/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ function stop_nginx

function install_pip
{
# If already installed - nothing to do
if which pip3 >/dev/null; then
return
fi

source /etc/os-release
if [[ "$ID" == ubuntu ]] && [[ "$VERSION_CODENAME" == bionic ]]; then
Expand Down Expand Up @@ -110,10 +114,10 @@ function install_certbot
install_pip || return

# Install pip3 dependencies
/usr/local/bin/pip3 install --user --upgrade setuptools_rust certbot certbot-dns-subdomain-provider
/usr/local/bin/pip3 install --user --upgrade pip
/usr/local/bin/pip3 install --user --upgrade cryptography
/usr/local/bin/pip3 install pyopenssl --upgrade
pip3 install --user --upgrade setuptools_rust certbot certbot-dns-subdomain-provider
pip3 install --user --upgrade pip || true
pip3 install --user --upgrade cryptography
pip3 install pyopenssl --upgrade
}

function start_apache
Expand Down

0 comments on commit 78c0b56

Please sign in to comment.