mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-02 05:46:25 -06:00
Merge ea9e23bf46
into 5a1877087f
This commit is contained in:
commit
022f6356a1
14
upgrade.sh
14
upgrade.sh
@ -20,9 +20,17 @@ COMMAND="${PREFIX}find . -name \"*.pyc\" -delete"
|
|||||||
echo "Cleaning up stale Python bytecode ($COMMAND)..."
|
echo "Cleaning up stale Python bytecode ($COMMAND)..."
|
||||||
eval $COMMAND
|
eval $COMMAND
|
||||||
|
|
||||||
# Fall back to pip3 if pip is missing
|
# Prefer Python 3
|
||||||
PIP="pip"
|
PIP=pip
|
||||||
type $PIP >/dev/null 2>&1 || PIP="pip3"
|
if type -P pip3 >/dev/null 2>&1; then
|
||||||
|
# We're likely on something Debian-based with numbered coexistent pythons.
|
||||||
|
# If we're running 3.4 or better, use pip3 and invoke scripts with python3
|
||||||
|
pip_version=$(pip3 --version | sed -e 's/.*(python \(.*\))/\1/')
|
||||||
|
if [[ ${pip_version:0:1} == 3 && ${pip_version:2:1} -gt 3 ]]; then
|
||||||
|
PIP=pip3
|
||||||
|
find . -type f -name '*.py' -execdir sed -i -e '1s/python/python3/' {} +
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Install any new Python packages
|
# Install any new Python packages
|
||||||
COMMAND="${PREFIX}${PIP} install -r requirements.txt --upgrade"
|
COMMAND="${PREFIX}${PIP} install -r requirements.txt --upgrade"
|
||||||
|
Loading…
Reference in New Issue
Block a user