2626# ======================================================================================================================
2727set -o nounset # Treat unset variables as an error
2828
29- __ScriptVersion=" 2024.11.26 "
29+ __ScriptVersion=" 2024.11.27 "
3030__ScriptName=" bootstrap-salt.sh"
3131
3232__ScriptFullName=" $0 "
@@ -2742,44 +2742,6 @@ __install_salt_from_repo() {
27422742
27432743 echodebug " Installed pip version: $( ${_pip_cmd} --version) "
27442744
2745- CHECK_PIP_VERSION_SCRIPT=$( cat << EOM
2746- import sys
2747- try:
2748- import pip
2749- installed_pip_version=tuple([int(part.strip()) for part in pip.__version__.split('.') if part.isdigit()])
2750- desired_pip_version=($( echo ${_MINIMUM_PIP_VERSION} | sed ' s/\./, /g' ) )
2751- if installed_pip_version < desired_pip_version:
2752- print('Desired pip version {!r} > Installed pip version {!r}'.format('.'.join(map(str, desired_pip_version)), '.'.join(map(str, installed_pip_version))))
2753- sys.exit(1)
2754- print('Desired pip version {!r} < Installed pip version {!r}'.format('.'.join(map(str, desired_pip_version)), '.'.join(map(str, installed_pip_version))))
2755- sys.exit(0)
2756- except ImportError:
2757- print('Failed to import pip')
2758- sys.exit(1)
2759- EOM
2760- )
2761- if ! ${_py_exe} -c " $CHECK_PIP_VERSION_SCRIPT " ; then
2762- # Upgrade pip to at least 1.2 which is when we can start using "python3 -m pip"
2763- echodebug " Running '${_pip_cmd} install ${_PIP_INSTALL_ARGS} pip>=${_MINIMUM_PIP_VERSION} '"
2764- ${_pip_cmd} install ${_PIP_INSTALL_ARGS} -v " pip>=${_MINIMUM_PIP_VERSION} "
2765- sleep 1
2766- echodebug " PATH: ${PATH} "
2767- _pip_cmd=" pip${_py_version} "
2768- if ! __check_command_exists " ${_pip_cmd} " ; then
2769- echodebug " The pip binary '${_pip_cmd} ' was not found in PATH"
2770- _pip_cmd=" pip$( echo " ${_py_version} " | cut -c -1) "
2771- if ! __check_command_exists " ${_pip_cmd} " ; then
2772- echodebug " The pip binary '${_pip_cmd} ' was not found in PATH"
2773- _pip_cmd=" pip"
2774- if ! __check_command_exists " ${_pip_cmd} " ; then
2775- echoerror " Unable to find a pip binary"
2776- return 1
2777- fi
2778- fi
2779- fi
2780- echodebug " Installed pip version: $( ${_pip_cmd} --version) "
2781- fi
2782-
27832745 _setuptools_dep=" setuptools>=${_MINIMUM_SETUPTOOLS_VERSION} ,<${_MAXIMUM_SETUPTOOLS_VERSION} "
27842746 if [ " $_PY_MAJOR_VERSION " -ne 3 ]; then
27852747 echoerror " Python version is no longer supported, only Python 3"
@@ -2802,7 +2764,6 @@ EOM
28022764
28032765 mkdir -p /tmp/git/deps
28042766 echodebug " Created directory /tmp/git/deps"
2805- echodebug " Installing Salt dependencies for Salt version $( python3 salt/version.py) "
28062767
28072768 if [ ${DISTRO_NAME_L} = " ubuntu" ] && [ " $DISTRO_MAJOR_VERSION " -eq 22 ]; then
28082769 echodebug " Ubuntu 22.04 has problem with base.txt requirements file, not parsing sys_platform == 'win32', upgrading from default pip works"
@@ -2815,20 +2776,23 @@ EOM
28152776 fi
28162777 fi
28172778
2818- echoinfo " Downloading Salt Dependencies from PyPi"
2819- echodebug " Running '${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .'"
2820- ${_pip_cmd} download -d /tmp/git/deps ${_PIP_DOWNLOAD_ARGS} .
2779+ rm -f /tmp/git/deps/*
2780+
2781+ echodebug " Installing Salt requirements from PyPi, ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} -r requirements/static/ci/py${_py_version} /linux.txt"
2782+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} -r " requirements/static/ci/py${_py_version} /linux.txt"
28212783 # shellcheck disable=SC2181
28222784 if [ $? -ne 0 ]; then
2823- echo " Failed to download salt dependencies "
2785+ echo " Failed to install salt requirements for the version of Python ${_py_version} "
28242786 return 1
28252787 fi
28262788
2827-
2828- echoinfo " Installing Downloaded Salt Dependencies"
2829- echodebug " Running '${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} /tmp/git/deps/*'"
2830- ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed ${_PIP_INSTALL_ARGS} /tmp/git/deps/* || return 1
2831- rm -f /tmp/git/deps/*
2789+ if [ " ${OS_NAME} " = " Linux" ]; then
2790+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.functools==4.1.0" || return 1
2791+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.text==4.0.0" || return 1
2792+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.collections==5.1.0" || return 1
2793+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.context==6.0.1" || return 1
2794+ ${_pip_cmd} install ${_USE_BREAK_SYSTEM_PACKAGES} --ignore-installed --upgrade ${_PIP_INSTALL_ARGS} " jaraco.classes==3.4.0" || return 1
2795+ fi
28322796
28332797 echoinfo " Building Salt Python Wheel"
28342798 if [ " $_ECHO_DEBUG " -eq $BS_TRUE ]; then
@@ -5139,79 +5103,79 @@ install_oracle_linux_check_services() {
51395103
51405104# ######################################################################################################################
51415105#
5142- # RockyLinux Install Functions
5106+ # ALmaLinux Install Functions
51435107#
5144- install_rockylinux_stable_deps () {
5108+ install_almalinux_stable_deps () {
51455109 install_centos_stable_deps || return 1
51465110 return 0
51475111}
51485112
5149- install_rockylinux_git_deps () {
5113+ install_almalinux_git_deps () {
51505114 install_centos_git_deps || return 1
51515115 return 0
51525116}
51535117
5154- install_rockylinux_onedir_deps () {
5118+ install_almalinux_onedir_deps () {
51555119 install_centos_onedir_deps || return 1
51565120 return 0
51575121}
51585122
5159- install_rockylinux_testing_deps () {
5123+ install_almalinux_testing_deps () {
51605124 install_centos_testing_deps || return 1
51615125 return 0
51625126}
51635127
5164- install_rockylinux_stable () {
5128+ install_almalinux_stable () {
51655129 install_centos_stable || return 1
51665130 return 0
51675131}
51685132
5169- install_rockylinux_git () {
5133+ install_almalinux_git () {
51705134 install_centos_git || return 1
51715135 return 0
51725136}
51735137
5174- install_rockylinux_onedir () {
5138+ install_almalinux_onedir () {
51755139 install_centos_onedir || return 1
51765140 return 0
51775141}
51785142
5179- install_rockylinux_testing () {
5143+ install_almalinux_testing () {
51805144 install_centos_testing || return 1
51815145 return 0
51825146}
51835147
5184- install_rockylinux_stable_post () {
5148+ install_almalinux_stable_post () {
51855149 install_centos_stable_post || return 1
51865150 return 0
51875151}
51885152
5189- install_rockylinux_git_post () {
5153+ install_almalinux_git_post () {
51905154 install_centos_git_post || return 1
51915155 return 0
51925156}
51935157
5194- install_rockylinux_onedir_post () {
5158+ install_almalinux_onedir_post () {
51955159 install_centos_onedir_post || return 1
51965160 return 0
51975161}
51985162
5199- install_rockylinux_testing_post () {
5163+ install_almalinux_testing_post () {
52005164 install_centos_testing_post || return 1
52015165 return 0
52025166}
52035167
5204- install_rockylinux_restart_daemons () {
5168+ install_almalinux_restart_daemons () {
52055169 install_centos_restart_daemons || return 1
52065170 return 0
52075171}
52085172
5209- install_rockylinux_check_services () {
5173+ install_almalinux_check_services () {
52105174 install_centos_check_services || return 1
52115175 return 0
52125176}
52135177#
5214- # Ended RockyLinux Install Functions
5178+ # Ended AlmaLinux Install Functions
52155179#
52165180# ######################################################################################################################
52175181
@@ -6373,7 +6337,7 @@ install_photon_deps() {
63736337 __PACKAGES=" ${__PACKAGES} libyaml procps-ng python${PY_PKG_VER} -crypto python${PY_PKG_VER} -jinja2"
63746338 __PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -msgpack python${PY_PKG_VER} -requests python${PY_PKG_VER} -zmq"
63756339 __PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -pip python${PY_PKG_VER} -m2crypto python${PY_PKG_VER} -pyyaml"
6376- __PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -systemd"
6340+ __PACKAGES=" ${__PACKAGES} python${PY_PKG_VER} -systemd sudo shadow "
63776341
63786342 if [ " ${_EXTRA_PACKAGES} " != " " ]; then
63796343 echoinfo " Installing the following extra packages as requested: ${_EXTRA_PACKAGES} "
@@ -6423,6 +6387,14 @@ install_photon_git_deps() {
64236387 __PACKAGES=" ${__PACKAGES} git"
64246388 fi
64256389
6390+ if ! __check_command_exists sudo; then
6391+ __PACKAGES=" ${__PACKAGES} sudo"
6392+ fi
6393+
6394+ if ! __check_command_exists usermod; then
6395+ __PACKAGES=" ${__PACKAGES} shadow"
6396+ fi
6397+
64266398 if [ -n " ${__PACKAGES} " ]; then
64276399 # shellcheck disable=SC2086
64286400 __tdnf_install_noinput ${__PACKAGES} || return 1
@@ -6471,6 +6443,8 @@ install_photon_git() {
64716443 return 1
64726444 fi
64736445
6446+ install_photon_git_deps
6447+
64746448 if [ -f " ${_SALT_GIT_CHECKOUT_DIR} /salt/syspaths.py" ]; then
64756449 ${_PYEXE} setup.py --salt-config-dir=" $_SALT_ETC_DIR " --salt-cache-dir=" ${_SALT_CACHE_DIR} " ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1
64766450 else
@@ -6579,7 +6553,7 @@ install_photon_onedir_deps() {
65796553 __install_saltstack_photon_onedir_repository || return 1
65806554 fi
65816555
6582- __PACKAGES=" procps-ng"
6556+ __PACKAGES=" procps-ng sudo shadow "
65836557
65846558 # shellcheck disable=SC2086
65856559 __tdnf_install_noinput ${__PACKAGES} || return 1
0 commit comments