www-apps/netbox: Correcting upgrade patch

Package-Manager: Portage-3.0.13, Repoman-3.0.2
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr
This commit is contained in:
Alarig Le Lay 2021-03-15 15:11:10 +01:00
parent 2d0b625633
commit b4448317d6
Signed by: alarig
GPG key ID: 7AFE62C6DF8BCDEC
3 changed files with 53 additions and 34 deletions

View file

@ -0,0 +1,51 @@
--- a/upgrade.sh 2021-03-15 14:54:09.287164820 +0100
+++ b/upgrade.sh 2021-03-15 15:08:32.463687738 +0100
@@ -14,48 +14,6 @@
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"
echo "Applying database migrations ($COMMAND)..."

View file

@ -1,32 +0,0 @@
diff --git a/upgrade.sh b/upgrade.sh
index d17dec06..6972ed2f 100755
--- a/upgrade.sh
+++ b/upgrade.sh
@@ -10,27 +10,6 @@ cd "$(dirname "$0")"
PYTHON="python3"
PIP="pip3"
-# Uninstall any Python packages which are no longer needed
-COMMAND="${PIP} uninstall -r old_requirements.txt -y"
-echo "Removing old Python packages ($COMMAND)..."
-eval $COMMAND
-
-# Install any new Python packages
-COMMAND="${PIP} install -r requirements.txt --upgrade"
-echo "Updating required Python packages ($COMMAND)..."
-eval $COMMAND
-
-# Validate Python dependencies
-COMMAND="${PIP} check"
-echo "Validating Python dependencies ($COMMAND)..."
-eval $COMMAND || (
- echo "******** PLEASE FIX THE DEPENDENCIES BEFORE CONTINUING ********"
- echo "* Manually install newer version(s) of the highlighted packages"
- echo "* so that 'pip3 check' passes. For more information see:"
- echo "* https://github.com/pypa/pip/issues/988"
- exit 1
-)
-
# Apply any database migrations
COMMAND="${PYTHON} netbox/manage.py migrate"
echo "Applying database migrations ($COMMAND)..."

View file

@ -48,7 +48,7 @@ RDEPEND="
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}"/${PN}-2.6.7-no-pip.patch
"${FILESDIR}"/${P}-no-pip.patch
)
DISABLE_AUTOFORMATTING=YES