From df51893d22a7212472fde093adf1795cd50fb094 Mon Sep 17 00:00:00 2001 From: Liam Waldron Date: Wed, 1 Feb 2023 16:47:48 -0500 Subject: [PATCH] Update 'src/glacier' --- src/glacier | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/glacier b/src/glacier index d415829..02945c6 100755 --- a/src/glacier +++ b/src/glacier @@ -16,24 +16,28 @@ # You should have received a copy of the GNU General Public License # along with Glacier. If not, see . -source /etc/glacier/hooks +. /etc/glacier/hooks get_pkg() { printf "$blue[ i ]$reset Downloading archive for package '$2'...\n" - # Extremely ugly but does what it needs to do - $GLACIER_DOWNLOAD_BACKEND $GREPO1/$2.tar.gz || $GLACIER_DOWNLOAD_BACKEND $GREPO2/$2.tar.gz || $GLACIER_DOWNLOAD_BACKEND $GREPO3/$2.tar.gz || $GLACIER_DOWNLOAD_BACKEND $GREPO4/$2.tar.gz || $GLACIER_DOWNLOAD_BACKEND $GREPO5/$2.tar.gz || $GLACIER_DOWNLOAD_BACKEND $GREPO6/$2.tar.gz || $GLACIER_DOWNLOAD_BACKEND $GREPO7/$2.tar.gz || $GLACIER_DOWNLOAD_BACKEND $GREPO8/$2.tar.gz + for r in ${ALLOWED_REPOS[@]}; do + $GLACIER_DOWNLOAD_BACKEND $GREPO/${r}/$2.tar.gz + done + find $2.tar.gz if [ "$?" != "0" ]; then printf "$red[ $error ]$reset Package '$2' not found.\n" exit 1 fi - # same goes for this - $GLACIER_DOWNLOAD_BACKEND $GREPO1/$2.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO2/$2.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO3/$2.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO4/$2.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO5/$2.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO6/$2.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO7/$2.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO8/$2.tar.gz + printf "$blue[ i ]$reset Downloading checksum for package '$2'...\n" + for r in ${ALLOWED_REPOS[@]}; do + $GLACIER_DOWNLOAD_BACKEND $GREPO/${r}/$2.checksum + done + find $2.checksum if [ "$?" != "0" ]; then printf "$red[ $error ]$reset Package checksum not found.\n" exit 1 fi } - int_check() { if [ "$GLACIER_DO_INT_CHECK" = "true" ]; then printf "$blue[ i ]$reset Checking package integrity...\n" @@ -129,7 +133,7 @@ clear_cache() { # debug_info() { - printf "$blue>> Glacier v3.2.2$reset\n" + printf "$blue>> Glacier v3.3.0$reset\n" printf ">> Checking for valid download backend...\n" whereis wget whereis curl @@ -262,7 +266,7 @@ case $1 in exit 0 ;; -v|--version) - printf "${blue}Glacier v3.2.2${reset}\n" + printf "${blue}Glacier v3.3.0${reset}\n" exit 0 ;; -f|install)