Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ E.g., to install `rsync`, `git` and `nginx` OS packages and `apprise` python pac

## Notes:
- Package names entered should match the names in the relevant distro repo: https://pkgs.alpinelinux.org/packages or https://packages.ubuntu.com/
- To install a specific version of a package include it in the name e.g. `apprise==1.10.0`. Note that `apt` requires a single `=`, while `apk` and `pip` use double `==`.
- Setting the env var `INSTALL_PIP_PACKAGES` will result in automatic install of the `python3-dev` and `python3-pip` OS packages, updating of `pip` to the latest version and installation of the latest `setuptools` and `wheel` packages to set up the necessary environment.
- Any other OS dependency such as `make` or `git`, which may be needed by the pip install process, should be manually added to `INSTALL_PACKAGES`.
- The OS packages defined will be installed first, followed by the pip packages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash

# Exit if no installable packages are provided
if [ -z "${INSTALL_PACKAGES+x}" ] && [ -z "${INSTALL_PIP_PACKAGES+x}" ]; then
echo "**** No packages to install ****"
if [[ -z "${INSTALL_PACKAGES+x}" ]] && [[ -z "${INSTALL_PIP_PACKAGES+x}" ]]; then
echo "[pkg-install-init] **** No packages to install ****"
exit 0
fi

if [ -n "${INSTALL_PIP_PACKAGES}" ] && [ -f /usr/bin/apt ]; then
if [[ -n "${INSTALL_PIP_PACKAGES}" ]] && [[ -f /usr/bin/apt ]]; then
echo "\
python3-dev \
python3-pip" >> /mod-repo-packages-to-install.list
elif [ -n "${INSTALL_PIP_PACKAGES}" ] && [ -f /sbin/apk ]; then
elif [[ -n "${INSTALL_PIP_PACKAGES}" ]] && [[ -f /sbin/apk ]]; then
echo "\
python3-dev \
py3-pip" >> /mod-repo-packages-to-install.list
fi


#Split list of packages on delimiter '|'
IFS='|'
INSTALL_PACKAGES=(${INSTALL_PACKAGES})
for PKG in "${INSTALL_PACKAGES[@]}"; do
echo "**** Adding ${PKG} to OS package install list ****"
# Split list of packages on delimiter '|'
IFS="|" read -r -a SPLIT_INSTALL_PACKAGES <<< "${INSTALL_PACKAGES}"
for PKG in "${SPLIT_INSTALL_PACKAGES[@]}"; do
echo "[pkg-install-init] **** Adding ${PKG} to OS package install list ****"
echo "${PKG}" >> /mod-repo-packages-to-install.list
done

INSTALL_PIP_PACKAGES=(${INSTALL_PIP_PACKAGES})
for PKG in "${INSTALL_PIP_PACKAGES[@]}"; do
echo "**** Adding ${PKG} to pip install list ****"
IFS="|" read -r -a SPLIT_INSTALL_PIP_PACKAGES <<< "${INSTALL_PIP_PACKAGES}"
for PKG in "${SPLIT_INSTALL_PIP_PACKAGES[@]}"; do
echo "[pkg-install-init] **** Adding ${PKG} to pip install list ****"
echo "${PKG}" >> /mod-pip-packages-to-install.list
done