add support for pip packages

This commit is contained in:
aptalca
2022-09-26 16:55:56 -04:00
parent 3a2d1eb34f
commit c0e9fe3117
2 changed files with 33 additions and 7 deletions
@@ -1,16 +1,32 @@
#!/usr/bin/with-contenv bash
# Exit if no installable packages are provided
if [ -z ${INSTALL_PACKAGES+x} ]; then
if [ -z "${INSTALL_PACKAGES+x}" ] && [ -z "${INSTALL_PIP_PACKAGES+x}" ]; then
echo "**** No packages to install ****"
exit 0
fi
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
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 install list ****"
echo "**** 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 ****"
echo "${PKG}" >> /mod-pip-packages-to-install.list
done