From ac3c172a23081b2d3e7466b97186446956933ede Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 11 Mar 2019 10:51:03 +0100 Subject: [PATCH] add multiple package sources option --- .config/bootstrap/install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.config/bootstrap/install.sh b/.config/bootstrap/install.sh index 5b9e472..1138633 100644 --- a/.config/bootstrap/install.sh +++ b/.config/bootstrap/install.sh @@ -5,17 +5,22 @@ ### OPTIONS AND VARIABLES ### -while getopts ":a:r:p:h" o; do case "${o}" in +while getopts ":a:r:p:u:U:f:F:hq" o; do case "${o}" in h) printf "Optional arguments for custom use:\\n -r: Dotfiles repository (local file or url)\\n -p: Dependencies and programs csv (local file or url)\\n -a: AUR helper (must have pacman-like syntax)\\n -h: Show this message\\n" && exit ;; r) dotfilesrepo=${OPTARG} && git ls-remote "$dotfilesrepo" || exit ;; - p) progsfile=${OPTARG} ;; a) aurhelper=${OPTARG} ;; + f) progsfile=${OPTARG} ;; + F) progsfile=${OPTARG} && exclusiveprogsfile=true ;; + p) packagegroups=${OPTARG} ;; + u) targetuser=${OPTARG} ;; + U) targetpassword=${OPTARG} ;; + q) quietmode=true;; *) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;; esac done # DEFAULTS: [ -z "$dotfilesrepo" ] && dotfilesrepo="https://gitlab.com/marty-oehme/dotfiles.git" -[ -z "$progsfile" ] && progsfile="https://gitlab.com/marty-oehme/dotfiles/snippets/1828258/raw" +[ ! "$exclusiveprogsfile" ] && progsfile="$(curl -Ls https://gitlab.com/marty-oehme/dotfiles/snippets/1828258/raw | cat ) $progsfile" [ -z "$aurhelper" ] && aurhelper="yay" ### FUNCTIONS ### @@ -108,7 +113,6 @@ gatherpackages() { } installationloop() { \ - ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' > /tmp/progs.csv total=$(wc -l < /tmp/progs.csv) aurinstalled=$(pacman -Qm | awk '{print $1}') while IFS=, read -r tag program comment; do @@ -213,6 +217,7 @@ manualinstall $aurhelper || error "Failed to install AUR helper." # installs each needed program the way required. Be sure to run this only after # the user has been created and has priviledges to run sudo without a password # and all build dependencies are installed. +gatherpackages $progsfile installationloop # Install the dotfiles in the user's home directory