v2.3.0 - Package integrity checking

This commit is contained in:
lw-everestlinux 2022-09-06 12:34:32 -04:00
parent 22e368c5fa
commit 0807a13286
6 changed files with 26 additions and 7 deletions

View File

@ -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`.

View File

@ -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."
printf "[ i ] Glacier has finished installing."

14
scripts/GLACIER_INTEGRITY_CHECK Executable file
View File

@ -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

12
scripts/glacier Normal file → Executable file
View File

@ -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

0
scripts/glacier.conf Normal file → Executable file
View File

0
scripts/hooks.sh Normal file → Executable file
View File