summaryrefslogtreecommitdiff
path: root/scripts/apkworld
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-05-06 19:42:17 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2026-05-06 23:00:08 +0200
commit453436ee53cd9935473cf1944dd072281d69a99f (patch)
tree84d1c7ba8c4a748ce815da0ac4c06301c83ef169 /scripts/apkworld
parentf9e0eda68d23e00547bbc28902b5bd5ef13bd44b (diff)
downloadconfig-453436ee53cd9935473cf1944dd072281d69a99f.tar.gz
config-453436ee53cd9935473cf1944dd072281d69a99f.zip
Setup config alpine script
Diffstat (limited to 'scripts/apkworld')
-rwxr-xr-xscripts/apkworld11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/apkworld b/scripts/apkworld
index 8200983..91deb8e 100755
--- a/scripts/apkworld
+++ b/scripts/apkworld
@@ -3,10 +3,13 @@
3# Install and remove packages from a configuration file. 3# Install and remove packages from a configuration file.
4 4
5# Usage: apkworld [file] 5# Usage: apkworld [file]
6# Requires: apk (Alpine Linux package manager) 6# Requires: apk (Alpine Linux package manager), doas (or sudo)
7 7
8PACKAGES="${1:-$HOME/.config/alpine-packages}" 8PACKAGES="${1:-$HOME/.config/alpine-packages}"
9SUDO_CMD=doas
9 10
10cp /etc/apk/world /etc/apk/world.backup 11tmp_file=$(mktemp)
11cat "$PACKAGES" | sed 's/#.*//' | grep -v '^[:space:]*$' > /etc/apk/world 12doas cp /etc/apk/world /etc/apk/world.backup
12apk fix 13cat "$PACKAGES" | sed 's/#.*//' | grep -v '^[:space:]*$' > $tmp_file
14doas mv $tmp_file /etc/apk/world
15doas apk fix

Generated with cgit - Back to sebastiano.tronto.net