Skip to content

Commit

Permalink
fix: python3 postinst fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fastcat committed Mar 21, 2020
1 parent db51489 commit 932a608
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spk/rdiff-backup/src/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DNAME="rdiff-backup"

# Others
INSTALL_DIR="/usr/local/${PACKAGE}"
PYTHON_DIR="/usr/local/python"
PYTHON_DIR="/usr/local/python3"
VIRTUALENV="${PYTHON_DIR}/bin/virtualenv"
PATH="${INSTALL_DIR}/env/bin:${INSTALL_DIR}/bin:${PYTHON_DIR}/bin:${PATH}"

Expand All @@ -21,13 +21,13 @@ postinst ()
ln -s ${SYNOPKG_PKGDEST} ${INSTALL_DIR}

# Create a Python virtualenv
${VIRTUALENV} ${INSTALL_DIR}/env > /dev/null
${VIRTUALENV} --system-site-packages ${INSTALL_DIR}/env > /dev/null

# Install the wheels
${INSTALL_DIR}/env/bin/pip install --no-deps --no-index -U --force-reinstall -f ${INSTALL_DIR}/share/wheelhouse ${INSTALL_DIR}/share/wheelhouse/*.whl > /dev/null 2>&1

# Fix shebang
sed -i -e "s|^#!.*$|#!${INSTALL_DIR}/env/bin/python|g" ${INSTALL_DIR}/env/bin/rdiff-backup
sed -i -e "s|^#!.*$|#!${INSTALL_DIR}/env/bin/python3|g" ${INSTALL_DIR}/env/bin/rdiff-backup

# Add symlink
mkdir -p /usr/local/bin
Expand Down

0 comments on commit 932a608

Please sign in to comment.