Skip to content

Commit 792a949

Browse files
Merge pull request #105 from fledge-iot/FOGL-9890
FOGL-9890 fixes specific to newer Debian-based systems like Ubuntu 24.04 and Debian 12+
2 parents 92bc7f1 + 1d8ec4a commit 792a949

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/Debian/common/DEBIAN/postinst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,14 @@ install_pip3_packages () {
125125
PYTHON_MAJOR=$(echo "$PYTHON_VERSION" | cut -d. -f1)
126126
PYTHON_MINOR=$(echo "$PYTHON_VERSION" | cut -d. -f2)
127127

128-
FLAG=""
129-
# Set the FLAG only for Python versions 3.11 or higher
130-
if [ "$PYTHON_MAJOR" -gt 3 ] || { [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -ge 11 ]; }; then
128+
if [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -ge 11 ] && [ "$PYTHON_MINOR" -lt 12 ]; then
131129
FLAG="--break-system-packages"
130+
elif [ "$PYTHON_MAJOR" -eq 3 ] && [ "$PYTHON_MINOR" -ge 12 ]; then
131+
FLAG="--ignore-installed --break-system-packages"
132+
else
133+
# Default to empty flag
134+
FLAG=""
132135
fi
133-
134136
# Install pip and packages with or without the flag
135137
python3 -m pip install --upgrade pip $FLAG
136138
python3 -m pip install -r /usr/local/fledge/python/requirements.txt $FLAG

0 commit comments

Comments
 (0)