summaryrefslogtreecommitdiff
path: root/update-cleansystem
blob: d4ad943289850d9f3986383bb912bddd9d69dd21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Updates the cleansystem file
# Creates a fake Parabola root and prints all packages installable from base
# and base-devel plus extras

set -E

if [ ! -w / ]; then
    echo "Run as root."
    exit 1
fi

tmpdir=/tmp/cleansystem.${RANDOM}

mkdir -p ${tmpdir}/var/lib/pacman

# We sync first because updating info gets printed to stdout too
pacman -r ${tmpdir} --config /etc/pacman.conf -Sy
pacman -r ${tmpdir} \
       --config /etc/pacman.conf \
       -Sp --print-format "%n" \
       base base-devel ${@} | sort > $(dirname $0)/cleansystem

exit $?