add multiple package sources option
This commit is contained in:
parent
5b2870b0a9
commit
ac3c172a23
1 changed files with 9 additions and 4 deletions
|
|
@ -5,17 +5,22 @@
|
||||||
|
|
||||||
### OPTIONS AND VARIABLES ###
|
### 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 ;;
|
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 ;;
|
r) dotfilesrepo=${OPTARG} && git ls-remote "$dotfilesrepo" || exit ;;
|
||||||
p) progsfile=${OPTARG} ;;
|
|
||||||
a) aurhelper=${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 ;;
|
*) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;;
|
||||||
esac done
|
esac done
|
||||||
|
|
||||||
# DEFAULTS:
|
# DEFAULTS:
|
||||||
[ -z "$dotfilesrepo" ] && dotfilesrepo="https://gitlab.com/marty-oehme/dotfiles.git"
|
[ -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"
|
[ -z "$aurhelper" ] && aurhelper="yay"
|
||||||
|
|
||||||
### FUNCTIONS ###
|
### FUNCTIONS ###
|
||||||
|
|
@ -108,7 +113,6 @@ gatherpackages() {
|
||||||
}
|
}
|
||||||
|
|
||||||
installationloop() { \
|
installationloop() { \
|
||||||
([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' > /tmp/progs.csv
|
|
||||||
total=$(wc -l < /tmp/progs.csv)
|
total=$(wc -l < /tmp/progs.csv)
|
||||||
aurinstalled=$(pacman -Qm | awk '{print $1}')
|
aurinstalled=$(pacman -Qm | awk '{print $1}')
|
||||||
while IFS=, read -r tag program comment; do
|
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
|
# 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
|
# the user has been created and has priviledges to run sudo without a password
|
||||||
# and all build dependencies are installed.
|
# and all build dependencies are installed.
|
||||||
|
gatherpackages $progsfile
|
||||||
installationloop
|
installationloop
|
||||||
|
|
||||||
# Install the dotfiles in the user's home directory
|
# Install the dotfiles in the user's home directory
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue