v2.3.0 - package integrity checking

This commit is contained in:
lw-everestlinux 2022-09-06 13:54:31 -04:00
parent b5c28dd802
commit 5688b4753d
3 changed files with 24 additions and 12 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
ORIGIN_CHECKSUM=$(curl -o https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world/$input.checksum $input.checksum)
ORIGIN_CHECKSUM=$($GLACIER_DOWNLOAD_BACKEND $GREPO1/$input.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO2/$input.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO3/$input.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO4/$input.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO5/$input.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO6/$input.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO7/$input.checksum || $GLACIER_DOWNLOAD_BACKEND $GREPO8/$input.checksum)
PKG_CHECKSUM=$(sha256sum $input.tar.gz)

View File

@ -66,6 +66,9 @@ while [[ $# -gt 0 ]]; do
mkdir $input && mv $input.tar.gz $input && cd $input
printf "$blue [ i ]$reset Verifying integrity of package...\n"
GLACIER_INTEGRITY_CHECK
if [ "$?" != "0" ]; then
exit 0
fi
tar -xf $input.tar.gz
if [ "$?" != "0" ]; then
printf "\033[1;31m [ \xE2\x9C\x95 ] \033[m Could not unpack $input.tar.gz.\n" 1>&2
@ -111,6 +114,9 @@ while [[ $# -gt 0 ]]; do
mkdir $input && mv $input.tar.gz $input && cd $input
printf "$blue [ i ]$reset Verifying integrity of package...\n"
GLACIER_INTEGRITY_CHECK
if [ "$?" != "0" ]; then
exit 0
fi
tar -xf $input.tar.gz
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz.\n" 1>&2
@ -153,6 +159,9 @@ while [[ $# -gt 0 ]]; do
mkdir $input && mv $input.tar.gz $input && cd $input
printf "$blue [ i ]$reset Verifying integrity of package...\n"
GLACIER_INTEGRITY_CHECK
if [ "$?" != "0" ]; then
exit 0
fi
tar -xf $input.tar.gz
if [ "$?" != "0" ]; then
printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz.\n" 1>&2
@ -201,6 +210,9 @@ while [[ $# -gt 0 ]]; do
fi
printf "$blue [ i ]$reset Verifying integrity of package...\n"
GLACIER_INTEGRITY_CHECK
if [ "$?" != "0" ]; then
exit 0
fi
mv $input.tar.gz /var/cache/glacier
printf "\033[1;32m [ $check ] \033[m Operation completed.\n"
exit 0

View File

@ -5,14 +5,14 @@
#
# Repositories Glacier will use
GREPO1=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world # System Software
GREPO2=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/galaxy # GPL Only Software
GREPO3=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/universe # All Open Source Software
#GREPO4=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/multiverse # Proprietary Software
#GREPO5=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world-testing
#GREPO6=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/galaxy-testing
#GREPO7=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/universe-testing
#GREPO8=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/multiverse-testing
export GREPO1=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world # System Software
export GREPO2=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/galaxy # GPL Only Software
export GREPO3=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/universe # All Open Source Software
#export GREPO4=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/multiverse # Proprietary Software
#export GREPO5=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world-testing
#export GREPO6=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/galaxy-testing
#export GREPO7=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/universe-testing
#export GREPO8=https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/multiverse-testing
# Define colors and unicode symbols to be used
export red="\033[1;31m"
@ -27,9 +27,9 @@
# Which backend Glacier will use to download files
# Selecting more than one backend will cause breakage
GLACIER_DOWNLOAD_BACKEND="wget --quiet --show-progress"
#GLACIER_DOWNLOAD_BACKEND="curl --output $input.tar.gz"
#GLACIER_DOWNLOAD_BACKEND="aria2c"
export GLACIER_DOWNLOAD_BACKEND="wget --quiet --show-progress"
#export GLACIER_DOWNLOAD_BACKEND="curl --output $input.tar.gz"
#export GLACIER_DOWNLOAD_BACKEND="aria2c"
#
# end /etc/glacier.conf