Glacier v3.3.0 - Improvements to downloads

This commit is contained in:
Liam Waldron 2023-02-01 12:47:08 -05:00
parent bd07427378
commit 9c59513859
4 changed files with 96 additions and 60 deletions

View File

@ -18,20 +18,41 @@
source /etc/glacier/hooks
#get_pkg() {
# printf "$blue[ i ]$reset Downloading archive for package '$2'...\n"
# $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
# if [ "$?" != "0" ]; then
# printf "$red[ $error ]$reset Package '$2' not found.\n"
# exit 1
# fi
# $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
# if [ "$?" != "0" ]; then
# printf "$red[ $error ]$reset Package checksum not found.\n"
# exit 1
# fi
#}
get_pkg() {
printf "$blue[ i ]$reset Downloading archive for package '$2'...\n"
$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
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package '$2' not found.\n"
exit 1
fi
$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
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package checksum not found.\n"
exit 1
fi
}
for r in $ALLOWED_REPOS; do
$GLACIER_DOWNLOAD_BACKEND $GREPO/$r/$2.tar.gz
find $2.tar.gz
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package '$2' not found.\n"
exit 1
fi
done
printf "$blue[ i ]$reset Downloading checksum for package '$2'...\n"
for r in $ALLOWED_REPOS; do
$GLACIER_DOWNLOAD_BACKEND $GREPO/$r/$2.checksum
find $2.checksum
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package checksum not found.\n"
exit 1
fi
done
}
int_check() {
if [ "$GLACIER_DO_INT_CHECK" = "true" ]; then
printf "$blue[ i ]$reset Checking package integrity...\n"
@ -127,7 +148,7 @@ clear_cache() {
#
debug_info() {
printf "$blue>> Glacier v3.2.1$reset\n"
printf "$blue>> Glacier v3.3.0$reset\n"
printf ">> Checking for valid download backend...\n"
whereis wget
whereis curl
@ -250,7 +271,7 @@ case $1 in
exit 0
;;
-v|--version)
printf "${blue}Glacier v3.2.1${reset}\n"
printf "${blue}Glacier v3.3.0${reset}\n"
exit 0
;;
-f|install)

View File

@ -3,31 +3,10 @@
# For more information on each of these options, see https://git.everest
#
# Repositories Glacier will use
# Repository Glacier will download programs from
#[world]
export GREPO1="https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world" # System Software
#[galaxy]
export GREPO2="https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/galaxy" # GPL Only Software
#[universe]
export GREPO3="https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/universe" # All Open Source Software
#[multiverse]
#export GREPO4=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/multiverse # Proprietary Software
#[world-testing]
#export GREPO5=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world-testing
#[galaxy-testing]
#export GREPO6=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/galaxy-testing
#[universe-testing]
#export GREPO7=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/universe-testing
#[multiverse-testing]
#export GREPO8=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/multiverse-testing
export GREPO="https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main"
export ALLOWED_REPOS="world galaxy universe multiverse"
# Define colors and unicode symbols to be used
export red="\033[1;31m"
@ -47,8 +26,8 @@
#export GLACIER_DOWNLOAD_BACKEND="aria2c"
# Enable/disable package integrity checking
# This option requires Python to be installed
# WARNING: Keeping this enabled is strongly recommended.
# This option ensures all packages from the repositories are genuine.
export GLACIER_DO_INT_CHECK="true"

View File

@ -1,33 +1,64 @@
#!/bin/sh
# Glacier - manage installed packages on a Linux system
# This program is free software - you can distribute it
# under the terms of the GNU General Public License v3.0,
# or at your option, any later version.
#
# This file is part of Glacier.
#
# Glacier is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# Glacier is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
# A copy of the GNU General Public License should have been
# recieved along with this program. If not, see
# <https://www.gnu.org/licenses>
# You should have received a copy of the GNU General Public License
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
source $(pwd)/glacier.conf
source $(pwd)/hooks-test
#get_pkg() {
# printf "$blue[ i ]$reset Downloading archive for package '$2'...\n"
# $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
# if [ "$?" != "0" ]; then
# printf "$red[ $error ]$reset Package '$2' not found.\n"
# exit 1
# fi
# $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
# if [ "$?" != "0" ]; then
# printf "$red[ $error ]$reset Package checksum not found.\n"
# exit 1
# fi
#}
get_pkg() {
printf "$blue[ i ]$reset Downloading archive for package '$2'...\n"
$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
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package '$2' not found.\n"
exit 1
fi
$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
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package checksum not found.\n"
exit 1
fi
}
for r in $ALLOWED_REPOS; do
$GLACIER_DOWNLOAD_BACKEND $GREPO/$r/$2.tar.gz
find $2.tar.gz
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package '$2' not found.\n"
exit 1
fi
done
printf "$blue[ i ]$reset Downloading checksum for package '$2'...\n"
for r in $ALLOWED_REPOS; do
$GLACIER_DOWNLOAD_BACKEND $GREPO/$r/$2.checksum
find $2.checksum
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Package checksum not found.\n"
exit 1
fi
done
}
int_check() {
if [ "$GLACIER_DO_INT_CHECK" = "true" ]; then
printf "$blue[ i ]$reset Checking package integrity...\n"
/usr/bin/glacier-integrity-check
mv *.checksum local_sum
sha256sum *.tar.gz > pkg_sum
/usr/bin/glacier-integrity-check local_sum pkg_sum
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Integrity check failed.\n"
exit 1
@ -41,7 +72,7 @@ int_check() {
unpack_pkg() {
printf "$blue[ i ]$reset Unpacking $2.tar.gz...\n"
mkdir $2 && mv $2.tar.gz $2 && cd $2
tar -xf $2.tar.gz
pv $2.tar.gz | tar -xz
if [ "$?" != "0" ]; then
printf "$red[ $error ]$reset Could not unpack $2.tar.gz.\n"
cd .. && rm -rf $2
@ -117,7 +148,7 @@ clear_cache() {
#
debug_info() {
printf "$blue>> Glacier v3.2.0$reset\n"
printf "$blue>> Glacier v3.2.1$reset\n"
printf ">> Checking for valid download backend...\n"
whereis wget
whereis curl
@ -240,7 +271,7 @@ case $1 in
exit 0
;;
-v|--version)
printf "${blue}Glacier v3.2.0${reset}\n"
printf "${blue}Glacier v3.2.1${reset}\n"
exit 0
;;
-f|install)

5
src/test/hooks-test Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Glacier Preloading Hooks
source /etc/make.conf
source $(pwd)/glacier.conf