Concatenate packages from different files

This commit is contained in:
Marty Oehme 2019-03-10 23:58:19 +01:00
parent c768aa9983
commit 37784b46ad

View file

@ -97,6 +97,17 @@ aurinstall() { \
sudo -u "$name" $aurhelper -S --noconfirm "$1" >/dev/null 2>&1
}
# can be called with as many csv files filled with packages as necessary
# appends them all to one temporary file for the installation
gatherpackages() {
concfile=/tmp/progs.csv
touch $concfile
for progs in "$@"; do
([ -f "$progs" ] && cat "$progs" >> $concfile) || curl -Ls "$progs" | sed '/^#/d' >> $concfile
echo "appending" "$progs" "to" "$confile" ", sized" "$(stat -f \"%z $concfile\")"
done
}
installationloop() { \
([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' > /tmp/progs.csv
total=$(wc -l < /tmp/progs.csv)