summaryrefslogtreecommitdiff
path: root/scripts/apkworld
blob: 91deb8e203141679ba0daccbefa3aa6f57b69d69 (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

Generated with cgit - Back to sebastiano.tronto.net