From 37784b46ada862e75b9cdd2e7a6025f5040b772e Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 10 Mar 2019 23:58:19 +0100 Subject: [PATCH] Concatenate packages from different files --- .config/bootstrap/install.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.config/bootstrap/install.sh b/.config/bootstrap/install.sh index 799228d..b45a3e8 100644 --- a/.config/bootstrap/install.sh +++ b/.config/bootstrap/install.sh @@ -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)