diff --git a/README.md b/README.md index f718925..27687b5 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ Packages should be submitted by sending a pull request to https://github.com/eve # Latest News +9/6/22 > Added package integrity checking. v2.3.0 + +8/26/22 > 8/26/22 > Improved help message output and included a tarball for installation through the ELIF. v2.2.3 + 7/14/22 > Download backend can now be changed. v2.2 6/21/22 > Changed repositories in `glacier.conf` to reflect the migration from GitHub to `git.everestlinux.org`. diff --git a/install/INSTALL-GLACIER.sh b/install/INSTALL-GLACIER.sh index c4cf94a..5c07123 100644 --- a/install/INSTALL-GLACIER.sh +++ b/install/INSTALL-GLACIER.sh @@ -17,5 +17,6 @@ chmod +x ../scripts/glacier echo "[ i ] Installing glacier..." cd ../scripts mv glacier /bin +mv GLACIER_INTEGRITY_CHECK /bin touch /etc/make.conf -printf "[ i ] Glacier has finished installing." \ No newline at end of file +printf "[ i ] Glacier has finished installing." diff --git a/scripts/GLACIER_INTEGRITY_CHECK b/scripts/GLACIER_INTEGRITY_CHECK new file mode 100755 index 0000000..a9e2a0e --- /dev/null +++ b/scripts/GLACIER_INTEGRITY_CHECK @@ -0,0 +1,14 @@ +#!/bin/sh + +ORIGIN_CHECKSUM=$(curl -o https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world/$input.checksum $input.checksum) + +PKG_CHECKSUM=$(sha256sum $input.tar.gz) + +if [ "$ORIGIN_CHECKSUM" == "$PKG_CHECKSUM" ]; then + printf "$green [ $check ]$reset Integrity check passed.\n" + rm $input.checksum +else + printf "$red [ $error ]$reset Integrity check failed.\n" + rm $input.checksum + exit 1 +fi diff --git a/scripts/glacier b/scripts/glacier old mode 100644 new mode 100755 index f6b2ef3..299d516 --- a/scripts/glacier +++ b/scripts/glacier @@ -40,7 +40,7 @@ while [[ $# -gt 0 ]]; do exit 0 ;; --version) - printf "$blue Glacier v2.2.3 $reset\n" + printf "$blue Glacier v2.3.0 $reset\n" exit 0 ;; install|-f) @@ -62,7 +62,7 @@ while [[ $# -gt 0 ]]; do printf "\033[1;34m [ i ] \033[m Unpacking $input.tar.gz...\n" mkdir $input && mv $input.tar.gz $input && cd $input printf "$blue [ i ]$reset Verifying integrity of package...\n" - sha256sum $input.tar.gz + GLACIER_INTEGRITY_CHECK 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 @@ -107,7 +107,7 @@ while [[ $# -gt 0 ]]; do printf "\033[1;34m [ i ] \033[m Unpacking $input.tar.gz...\n" mkdir $input && mv $input.tar.gz $input && cd $input printf "$blue [ i ]$reset Verifying integrity of package...\n" - sha256sum $input.tar.gz + GLACIER_INTEGRITY_CHECK tar -xf $input.tar.gz if [ "$?" != "0" ]; then printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz.\n" 1>&2 @@ -149,7 +149,7 @@ while [[ $# -gt 0 ]]; do printf "\033[1;34m [ i ] \033[m Unpacking $input.tar.gz...\n" mkdir $input && mv $input.tar.gz $input && cd $input printf "$blue [ i ]$reset Verifying integrity of package...\n" - sha256sum $input.tar.gz + GLACIER_INTEGRITY_CHECK tar -xf $input.tar.gz if [ "$?" != "0" ]; then printf "\033[1;31m [ $error ] \033[m Could not unpack $input.tar.gz.\n" 1>&2 @@ -197,7 +197,7 @@ while [[ $# -gt 0 ]]; do exit 1 fi printf "$blue [ i ]$reset Verifying integrity of package...\n" - sha256sum $input.tar.gz + GLACIER_INTEGRITY_CHECK mv $input.tar.gz /var/cache/glacier printf "\033[1;32m [ $check ] \033[m Operation completed.\n" exit 0 @@ -255,7 +255,7 @@ while [[ $# -gt 0 ]]; do exit 0 ;; --showDebugInfo) - printf "Glacier v2.2.1\n" + printf "Glacier v2.3.0\n" printf ":: Checking for viable download backend...\n" whereis wget whereis curl diff --git a/scripts/glacier.conf b/scripts/glacier.conf old mode 100644 new mode 100755 diff --git a/scripts/hooks.sh b/scripts/hooks.sh old mode 100644 new mode 100755