Skip to content

Commit 7283ab2

Browse files
authored
Merge pull request #1141 from linuxserver/package-install-readme-and-logging
2 parents 1fe8f8f + 20a6026 commit 7283ab2

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

  • root/etc/s6-overlay/s6-rc.d/init-mod-universal-package-install-add-package

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ E.g., to install `rsync`, `git` and `nginx` OS packages and `apprise` python pac
1616
1717
## Notes:
1818
- Package names entered should match the names in the relevant distro repo: https://pkgs.alpinelinux.org/packages or https://packages.ubuntu.com/
19+
- 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 `==`.
1920
- 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.
2021
- 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`.
2122
- The OS packages defined will be installed first, followed by the pip packages.
Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
11
#!/usr/bin/with-contenv bash
2+
# shellcheck shell=bash
23

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

9-
if [ -n "${INSTALL_PIP_PACKAGES}" ] && [ -f /usr/bin/apt ]; then
10+
if [[ -n "${INSTALL_PIP_PACKAGES}" ]] && [[ -f /usr/bin/apt ]]; then
1011
echo "\
1112
python3-dev \
1213
python3-pip" >> /mod-repo-packages-to-install.list
13-
elif [ -n "${INSTALL_PIP_PACKAGES}" ] && [ -f /sbin/apk ]; then
14+
elif [[ -n "${INSTALL_PIP_PACKAGES}" ]] && [[ -f /sbin/apk ]]; then
1415
echo "\
1516
python3-dev \
1617
py3-pip" >> /mod-repo-packages-to-install.list
1718
fi
1819

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

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

0 commit comments

Comments
 (0)