Skip to content

Commit

Permalink
install-debian.sh: added possibility to override and specifiy alterna…
Browse files Browse the repository at this point in the history
…tive requirements.txt for python dependencies
  • Loading branch information
dschmitz2017 committed Oct 23, 2024
1 parent d2dab0c commit f5a77af
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions install-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ fi
#############################################################################
#############################################################################

show_env_for_debugging=0

fod_dir="/srv/flowspy"
venv_dir="/srv/venv"

Expand Down Expand Up @@ -136,6 +138,11 @@ ifc_setup__wait_for_ifc__in_runfod=0

findfix_file_permissions=1

#

requirements_txt__file__basename__default="requirements.txt"
requirements_txt__file__basename="$requirements_txt__file__basename__default"

##############################################################################
##############################################################################

Expand Down Expand Up @@ -341,6 +348,13 @@ while [ $# -gt 0 ]; do
#install_basesw_os=0
#install_basesw_python=0
install_fodproper=1
elif [ $# -ge 1 -a \( "$1" = "--pyrequirements" \) ]; then
shift 1
requirements_txt__file__basename="$1"
shift 1
elif [ "$1" = "--show-env" ]; then
shift 1
show_env_for_debugging=1
elif [ $# -ge 1 -a \( "$1" = "--supervisor" -o "$1" = "--supervisord" \) ]; then
shift 1
install_with_supervisord=1
Expand Down Expand Up @@ -660,11 +674,16 @@ python_version="$(python3 --version | cut -d ' ' -f 2,2)"
#if [ "$assume__sqlite_version__to_old" = 1 ]; then
# echo "$0: assume__sqlite_version__to_old=$assume__sqlite_version__to_old => using requirements-centos.txt" 1>&2
# cp "$fod_dir/requirements-centos.txt" "$fod_dir/requirements.txt"
if [ -e "$fod_dir/requirements.txt.python$python_version" ]; then
echo "$0: using python version specific $fod_dir/requirements.txt.python$python_version" 1>&2
cp "$fod_dir/requirements.txt.python$python_version" "$fod_dir/requirements.txt"
if [ "$requirements_txt__file__basename" != "$requirements_txt__file__basename__default" ]; then
echo "python reqs: using $fod_dir/$requirements_txt__file__basename" 1>&2
cp -f "$fod_dir/$requirements_txt__file__basename" "$fod_dir/requirements.txt"
else
echo "$0: using $fod_dir/requirements.txt" 1>&2
if [ -e "$fod_dir/requirements.txt.python$python_version" ]; then
echo "python reqs: using python version specific $fod_dir/requirements.txt.python$python_version" 1>&2
cp -f "$fod_dir/requirements.txt.python$python_version" "$fod_dir/requirements.txt"
else
echo "python reqs: using default $fod_dir/$requirements_txt__file__basename__default" 1>&2
fi
fi

#############################################################################
Expand Down Expand Up @@ -775,7 +794,9 @@ if [ "$install_fodproper" = 1 ]; then
source "$venv_dir/bin/activate"


export 1>&2
if [ "$show_env_for_debugging" = 1 ]; then
export 1>&2
fi

##

Expand Down

0 comments on commit f5a77af

Please sign in to comment.