summaryrefslogtreecommitdiff
path: root/scripts/apkworld
blob: 27483fe6b77d81011f198892f23db52c89fb67f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# Install and remove packages from a configuration file.

# Usage: apkworld [file]
# Requires: apk (Alpine Linux package manager), doas (or sudo)

PACKAGES="${1:-$HOME/.config/alpine-packages}"
SUDO_CMD=doas

tmp_file=$(mktemp)
doas cp /etc/apk/world /etc/apk/world.backup
cat "$PACKAGES" | sed 's/#.*//' | grep -v '^[:space:]*$' > $tmp_file
doas mv $tmp_file /etc/apk/world
doas apk fix --interactive

Generated with cgit - Back to sebastiano.tronto.net