commit d596445804aa70b162f4353fc59aa0166639ec69 parent 61995f5ae19449e7c25bde660ff5942d8c344ff6 Author: Mark Feller <mfeller@recurly.com> Date: Thu, 19 Dec 2019 14:55:58 -0700 working on installer Signed-off-by: Mark Feller <mfeller@recurly.com> Diffstat:
M | pkgs/fedora/install | | | 28 | +++++++--------------------- |
R | pkgs/fedora/packages.csv -> pkgs/fedora/packages | | | 0 |
2 files changed, 7 insertions(+), 21 deletions(-)
diff --git a/pkgs/fedora/install b/pkgs/fedora/install @@ -1,33 +1,19 @@ #!/bin/sh +cd "$(dirname "$0")" || exit 1 +set -e -progsfile={$progsfile:-"https://raw.githubusercontent.com/LukeSmithxyz/LARBS/master/progs.csv"} +pkgfile=${pkgfile:-"https://gitlab.com/mark.feller/rice/raw/master/pkgs/fedora/packages"} +tmpfile=/tmp/pkgs log() { - # Print a message prettily. - # - # This function uses the literal escape character (Ctrl+V+Escape) as - # a simple way of *safely* bypassing the escape sequence restrictions - # on 'printf %s'. Cheeky, I know. - # - # '\033[1;32m' Set text to color '2' and make it bold. - # '\033[m': Reset text formatting. - # '${3:-->}': If the 3rd argument is missing, set prefix to '->'. - # '${2:+[1;3Xm}': If the 2nd argument exists, set the text style of '$1'. - # '$((${#1}%5+1))': Color the package name based on its length. - # '${2:+[m}': If the 2nd argument exists, reset text formatting. printf '\033[1;33m%s \033[m%s\033[m %s\n' \ "${3:-->}" "${2:+[1;36m}$1${2:+[m}" "$2" } -die() { - # Print a message and exit with '1' (error). - log "$1" "$2" "!>" >&2 - exit 1 -} - -([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' | eval grep "$grepseq" > /tmp/progs.csv +# Copy a real file to our temp progsfile or attempt to curl the progsfile +([ -f "$pkgfile" ] && cp "$pkgfile" "$tmpfile") || curl -Ls "$pkgfile" > "$tmpfile" -packages=$(sed '/^$/d' packages.csv | sed '/^#/d') +packages=$(sed '/^$/d' /tmp/progs | sed '/^#/d') while IFS=' ' read -r program comment; do log "Installing $program $comment" dnf install -y $program diff --git a/pkgs/fedora/packages.csv b/pkgs/fedora/packages