From 590bd560cb4cabd43dd19be90e950b82e00bc859 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Tue, 21 May 2024 23:26:05 -0400 Subject: [PATCH] fix(quickget): remove use of grep -P and replace with portable equivalent --- quickget | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quickget b/quickget index 88fb68f..a31daf2 100755 --- a/quickget +++ b/quickget @@ -742,7 +742,7 @@ function releases_elementary() { function releases_endeavouros() { local ENDEAVOUR_RELEASES="" - ENDEAVOUR_RELEASES="$(web_pipe "https://mirror.alpix.eu/endeavouros/iso/" | LC_ALL="en_US.UTF-8" sort -Mr | grep -o -P '(?<=)' | grep -v 'x86_64' | cut -c 13- | head -n 5 | tr '\n' ' ')" + ENDEAVOUR_RELEASES="$(web_pipe "https://mirror.alpix.eu/endeavouros/iso/" | grep -o '' | sed 's/^.*//' | grep -v 'x86_64' | LC_ALL="en_US.UTF-8" sort -Mr | cut -c 13- | head -n 5 | tr '\n' ' ')" echo "${ENDEAVOUR_RELEASES,,}" } @@ -804,7 +804,7 @@ function editions_ghostbsd() { function releases_gnomeos() { #shellcheck disable=SC2046,SC2005 - echo "nightly" $(web_pipe "https://download.gnome.org/gnomeos/" | grep -o -P '(?<=[0-9]*/' | grep -o '[0-9]*' | sort -ru | tail -n 1) local ISO="cachyos-${EDITION}-linux-${REL}.iso" HASH=$(web_pipe "${URL}/${REL}/${ISO}.sha256" | cut -d' ' -f1) echo "${URL}/${REL}/${ISO} ${HASH}" @@ -1822,7 +1822,7 @@ function get_endeavouros() { local ISO="" local URL="https://mirror.alpix.eu/endeavouros/iso" # Find EndeavourOS releases from mirror, pick one matching release - ENDEAVOUR_RELEASES="$(web_pipe "${URL}/" | grep -o -P '(?<=)' | grep -v 'x86_64')" + ENDEAVOUR_RELEASES="$(web_pipe "${URL}/" | grep -o '' | sed 's/^.*//' | grep -v 'x86_64')" ISO="$(echo "${ENDEAVOUR_RELEASES}" | grep -i "${RELEASE}").iso" HASH=$(web_pipe "${URL}/${ISO}.sha512sum" | cut -d' ' -f1) echo "${URL}/${ISO} ${HASH}" @@ -1953,7 +1953,7 @@ function get_haiku() { function get_holoiso() { local HASH="" local URL="" - URL=$(web_pipe "https://api.github.com/repos/HoloISO/releases/releases" | jq ".[] | select(.tag_name==\"${RELEASE}\") | .body" | grep -Po "https://\S+holoiso.ru.eu.org/\S+.iso" | head -n 1) + URL=$(web_pipe "https://api.github.com/repos/HoloISO/releases/releases" | jq -r ".[] | select(.tag_name==\"${RELEASE}\") | .body" | sed -n 's/.*\(https:\/\/[^ ]*holoiso\.ru\.eu\.org\/[^ ]*\.iso\).*/\1/p' | head -n 1) echo "${URL} ${HASH}" }