Skip to content

Commit 3a07e9d

Browse files
committed
Merge remote-tracking branch 'origin/pr/577'
* origin/pr/577: Add Alpine (APK) Updates availability check
2 parents d8d5a6a + 8e5b7ec commit 3a07e9d

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

network/update-proxy-configs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,31 @@ EOF
139139
fi
140140

141141

142+
# APK (Aplinelinux) also
143+
if [ -e /etc/alpine-release ]; then
144+
if [ -n "$PROXY_ADDR" ]; then
145+
mkdir -p /run/qubes/bin
146+
cat > /run/qubes/bin/apk <<EOF
147+
#!/bin/bash
148+
### This file is automatically generated by Qubes ($0 script).
149+
### All modifications here will be lost.
150+
http_proxy="$PROXY_ADDR" \\
151+
https_proxy="$PROXY_ADDR" \\
152+
/sbin/apk "\$@"
153+
EOF
154+
chmod +x /run/qubes/bin/apk
155+
cat > /etc/profile.d/qubes-proxy.sh << EOF
156+
### This file is automatically generated by Qubes ($0 script).
157+
### All modifications here will be lost.
158+
export PATH=/run/qubes/bin:\$PATH
159+
EOF
160+
else
161+
rm -f /run/qubes/bin/apk
162+
rm -f /etc/profile.d/qubes-proxy.sh
163+
fi
164+
fi
165+
166+
142167
# DNF configuration doesn't support including other files
143168
# https://bugzilla.redhat.com/show_bug.cgi?id=1352234
144169
if [ -e /etc/dnf/dnf.conf ]; then

package-managers/upgrades-installed-check

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ elif [ -e /etc/gentoo-release ]; then
5252
emerge_output="$(emerge -puDv @world 2>&1)"
5353
exit_code="$?"
5454
echo "$emerge_output" | grep -qF -- '[ebuild' && echo "false" || echo "true"
55+
elif [ -e /etc/alpine-release ]; then
56+
## Alpine and APK based distros
57+
set -e
58+
set -o pipefail
59+
if ! $skip_refresh; then
60+
sudo apk update -q >&2
61+
fi
62+
upgrades="$(apk list --upgradable)"
63+
exit_code="$?"
64+
[ -n "${upgrades}" ] && echo "false" || echo "true"
5565
else
5666
echo "Check not implemented for this distribution" >&2
5767
exit 1

0 commit comments

Comments
 (0)