From 82d2e3079aaca0060cd75692ac481bc70ab53230 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 24 Nov 2019 16:17:14 +0100 Subject: [PATCH] Add simple package bootstrap script --- .config/bootstrap/install | 91 +++++++++++++++++++++++++ .config/bootstrap/packages.csv | 120 +++++++++++++++++++++++++++++++++ 2 files changed, 211 insertions(+) create mode 100755 .config/bootstrap/install create mode 100644 .config/bootstrap/packages.csv diff --git a/.config/bootstrap/install b/.config/bootstrap/install new file mode 100755 index 0000000..5bf818f --- /dev/null +++ b/.config/bootstrap/install @@ -0,0 +1,91 @@ +#!/bin/bash +# +# Simple app bootstrapping script + +#=== main function ============================================================ +# NAME: main +# DESCRIPTION: Display usage information for this script. +# PARAMETERS: see usage function +#============================================================================== +main() { + local cmd="" + local ret=0 + + case "$1" in + -v | --version) + printf "Package bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.1\n" + ;; + -h | --help) + printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n" + ;; + -f | --force) + install true + ;; + *) + install false + ;; + esac + shift + + $cmd "$@" + ret=$((ret + $?)) + exit $ret +} + +install_yay() { + # check for existing yay installation + if type yay >/dev/null 2>&1; then + echo "Existing yay installation found ..........................................." + return + fi + + # use tmp dir to make yay + target=$(mktemp -d) + git clone https://aur.archlinux.org/yay.git "$target" + cd "$target" || exit + makepkg -si +} + +update_repos() { + unattended="$1" + if "$unattended"; then + yay -Sqyy --noconfirm + else + yay -Syy + fi +} + +install_packages() { + unattended="$1" + if "$unattended"; then + yay -Squ --noconfirm --needed -