Skip to content

Commit 6cd995f

Browse files
committed
POSIX fixes
Signed-off-by: ashish-jabble <[email protected]>
1 parent 6a66a86 commit 6cd995f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

plugins/packages/DEBIAN/postinst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,20 @@ if [ -f /usr/local/fledge/python/extras_install___PLUGIN_NAME__.sh ]; then
4141
fi
4242
# Install Python pip dependencies; if any
4343
if [ -f /usr/local/fledge/__INSTALL_DIR__/requirements.txt ]; then
44+
4445
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}')
45-
PYTHON_MAJOR=$(echo "$PYTHON_VERSION" | cut -d. -f1)
46-
PYTHON_MINOR=$(echo "$PYTHON_VERSION" | cut -d. -f2)
46+
PYTHON_MAJOR=$(printf "%s" "$PYTHON_VERSION" | cut -d. -f1)
47+
PYTHON_MINOR=$(printf "%s" "$PYTHON_VERSION" | cut -d. -f2)
48+
49+
FLAG=''
4750

4851
if [ "$PYTHON_MAJOR" -eq 3 ]; then
4952
if [ "$PYTHON_MINOR" -ge 11 ] && [ "$PYTHON_MINOR" -lt 12 ]; then
50-
FLAG="--break-system-packages"
53+
FLAG='--break-system-packages'
5154
elif [ "$PYTHON_MINOR" -ge 12 ]; then
52-
FLAG="--ignore-installed --break-system-packages"
55+
FLAG='--ignore-installed --break-system-packages'
5356
else
54-
# Default to empty flag
55-
FLAG=""
57+
FLAG=''
5658
fi
5759
fi
5860
python3 -m pip install -Ir /usr/local/fledge/__INSTALL_DIR__/requirements.txt $FLAG

0 commit comments

Comments
 (0)