Skip to content

Commit c045c0a

Browse files
committed
Support universal mod package install
1 parent 4e2b246 commit c045c0a

File tree

6 files changed

+37
-0
lines changed

6 files changed

+37
-0
lines changed

root/etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/init-mods-package-install

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mods

Whitespace-only changes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
if [ -f "/mod-repo-packages-to-install.list" ]; then
4+
echo "**** Installing all mod packages ****"
5+
if [ -f /usr/bin/apt ]; then
6+
export DEBIAN_FRONTEND="noninteractive"
7+
apt-get update
8+
apt-get install -y --no-install-recommends \
9+
$(cat /mod-repo-packages-to-install.list)
10+
elif [ -f /sbin/apk ]; then
11+
apk add --no-cache \
12+
$(cat /mod-repo-packages-to-install.list)
13+
fi
14+
fi
15+
16+
if [ -f "/mod-pip-packages-to-install.list" ]; then
17+
echo "**** Installing all pip packages ****"
18+
python3 -m pip install -U pip wheel setuptools
19+
if [ -f /usr/bin/apt ]; then
20+
PIP_ARGS="-f https://wheel-index.linuxserver.io/ubuntu/"
21+
elif [ -f /sbin/apk ]; then
22+
ALPINE_VER=$(grep main /etc/apk/repositories | sed 's|.*alpine/v||' | sed 's|/main.*||')
23+
if [ "${ALPINE_VER}" = "3.14" ]; then
24+
PIP_ARGS="-f https://wheel-index.linuxserver.io/alpine/"
25+
else
26+
PIP_ARGS="-f https://wheel-index.linuxserver.io/alpine-${ALPINE_VER}/"
27+
fi
28+
fi
29+
python3 -m pip install ${PIP_ARGS} \
30+
$(cat /mod-pip-packages-to-install.list)
31+
fi
32+
33+
rm -rf \
34+
/mod-repo-packages-to-install.list \
35+
/mod-pip-packages-to-install.list
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oneshot
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/init-mods-package-install/run

root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mods-package-install

Whitespace-only changes.

0 commit comments

Comments
 (0)