www-apps/netbox: Avoid pip
Package-Manager: Portage-3.0.18, Repoman-3.0.2 Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
parent
1b0b741c58
commit
ca5a51a731
61
www-apps/netbox/files/netbox-2.11.3-no-pip.patch
Normal file
61
www-apps/netbox/files/netbox-2.11.3-no-pip.patch
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
--- a/upgrade.sh 2021-05-08 16:28:49.168776455 +0200
|
||||||
|
+++ b/upgrade.sh 2021-05-08 16:29:26.172932950 +0200
|
||||||
|
@@ -3,58 +3,6 @@
|
||||||
|
# its most recent release.
|
||||||
|
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
-VIRTUALENV="$(pwd -P)/venv"
|
||||||
|
-
|
||||||
|
-# Remove the existing virtual environment (if any)
|
||||||
|
-if [ -d "$VIRTUALENV" ]; then
|
||||||
|
- COMMAND="rm -rf ${VIRTUALENV}"
|
||||||
|
- echo "Removing old virtual environment..."
|
||||||
|
- eval $COMMAND
|
||||||
|
-else
|
||||||
|
- WARN_MISSING_VENV=1
|
||||||
|
-fi
|
||||||
|
-
|
||||||
|
-# Create a new virtual environment
|
||||||
|
-COMMAND="/usr/bin/python3 -m venv ${VIRTUALENV}"
|
||||||
|
-echo "Creating a new virtual environment at ${VIRTUALENV}..."
|
||||||
|
-eval $COMMAND || {
|
||||||
|
- echo "--------------------------------------------------------------------"
|
||||||
|
- echo "ERROR: Failed to create the virtual environment. Check that you have"
|
||||||
|
- echo "the required system packages installed and the following path is"
|
||||||
|
- echo "writable: ${VIRTUALENV}"
|
||||||
|
- echo "--------------------------------------------------------------------"
|
||||||
|
- exit 1
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-# Activate the virtual environment
|
||||||
|
-source "${VIRTUALENV}/bin/activate"
|
||||||
|
-
|
||||||
|
-# Upgrade pip
|
||||||
|
-COMMAND="pip install --upgrade pip"
|
||||||
|
-echo "Updating pip ($COMMAND)..."
|
||||||
|
-eval $COMMAND || exit 1
|
||||||
|
-pip -V
|
||||||
|
-
|
||||||
|
-# Install necessary system packages
|
||||||
|
-COMMAND="pip install wheel"
|
||||||
|
-echo "Installing Python system packages ($COMMAND)..."
|
||||||
|
-eval $COMMAND || exit 1
|
||||||
|
-
|
||||||
|
-# Install required Python packages
|
||||||
|
-COMMAND="pip install -r requirements.txt"
|
||||||
|
-echo "Installing core dependencies ($COMMAND)..."
|
||||||
|
-eval $COMMAND || exit 1
|
||||||
|
-
|
||||||
|
-# Install optional packages (if any)
|
||||||
|
-if [ -s "local_requirements.txt" ]; then
|
||||||
|
- COMMAND="pip install -r local_requirements.txt"
|
||||||
|
- echo "Installing local dependencies ($COMMAND)..."
|
||||||
|
- eval $COMMAND || exit 1
|
||||||
|
-elif [ -f "local_requirements.txt" ]; then
|
||||||
|
- echo "Skipping local dependencies (local_requirements.txt is empty)"
|
||||||
|
-else
|
||||||
|
- echo "Skipping local dependencies (local_requirements.txt not found)"
|
||||||
|
-fi
|
||||||
|
|
||||||
|
# Apply any database migrations
|
||||||
|
COMMAND="python3 netbox/manage.py migrate"
|
Loading…
Reference in a new issue