From 9372256310d15418d8ddcb0087d3a6dc8a48905e Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Sat, 3 Dec 2022 03:09:23 -0600 Subject: [PATCH] Various improvements --- ethernet-on-boot.sh | 0 ibus-on-boot.sh | 0 lure-update.sh | 11 +++++++---- 3 files changed, 7 insertions(+), 4 deletions(-) mode change 100755 => 100644 ethernet-on-boot.sh mode change 100755 => 100644 ibus-on-boot.sh diff --git a/ethernet-on-boot.sh b/ethernet-on-boot.sh old mode 100755 new mode 100644 diff --git a/ibus-on-boot.sh b/ibus-on-boot.sh old mode 100755 new mode 100644 diff --git a/lure-update.sh b/lure-update.sh index 8f682b1..937afd1 100644 --- a/lure-update.sh +++ b/lure-update.sh @@ -4,17 +4,20 @@ # The regular upgrade function of lure doesn't suffice since # I use automatically updating version names in my install scripts -[ -f "$1" ] || echo "Please pass location of a list with github repo names" +! command -v lure>/dev/null && echo "lure is not installed" && exit +! [ -f "$1" ] && echo "Please pass location of a list with github repo names" && exit + +lure_list=$(lure list --installed 2>/dev/null | grep -v 'INF') for f in $(cat "$1" | tr '\n' ' ') do pkg="$(echo $f | cut -d '/' -f 2)" - version_new=$(lure info $pkg | grep version | awk '{printf $2}' | sed 's/[a-zA-Z]*//g') + version_new=$(lure info $pkg 2>/dev/null | grep version | awk '{printf $2}' | sed 's/[a-zA-Z]*//g') [ "$version_new" == "" ] && version_new="$(curl -sL "https://api.github.com/repos/${f}/releases/latest" | jq -r '.tag_name' | sed 's/[a-zA-Z]*//g')" - version_present="$(dnf info $pkg 2>/dev/null | grep Version | awk '{printf $3}' | sed 's/[a-zA-Z]*//g')" + version_present=$(echo "$lure_list" | grep $pkg | cut -d' ' -f2 | cut -d- -f1 | sed 's/[a-zA-Z]*//g') [ "$version_present" == "" ] && echo "$pkg isn't installed, skipping" && continue if [ $(echo $version_present$'\n'$version_new | sort -V | tail -n1) != $version_present ]; then - echo "Upgrading $pkg" + echo "Upgrading $pkg ($version_present -> $version_new)" lure install $pkg else echo "$pkg is up-to-date"