Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
f3b9e04edd | |||
927b02c0f3 | |||
5b93cb7aba | |||
87b85db1ce | |||
66611d0b70 | |||
9c59513859 |
8
install/post-install-2-1-23.sh
Executable file
8
install/post-install-2-1-23.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
WORKING_DIR=$(pwd)
|
||||||
|
SRC_DIR=$(pwd)/../src
|
||||||
|
|
||||||
|
mv /etc/glacier.conf /etc/glacier.conf.old
|
||||||
|
echo "WARNING: /etc/glacier.conf saved as /etc/glacier.conf.old\n"
|
||||||
|
mv $SRC_DIR/glacier.conf /etc
|
76
src/glacier
76
src/glacier
@ -16,22 +16,28 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
|
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
source /etc/glacier/hooks
|
. /etc/glacier/hooks
|
||||||
|
|
||||||
get_pkg() {
|
get_pkg() {
|
||||||
printf "$blue[ i ]$reset Downloading archive for package '$2'...\n"
|
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
|
for r in ${ALLOWED_REPOS[@]}; do
|
||||||
|
$GLACIER_DOWNLOAD_BACKEND $GREPO/${r}/$2.tar.gz
|
||||||
|
done
|
||||||
|
find $2.tar.gz
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
printf "$red[ $error ]$reset Package '$2' not found.\n"
|
printf "$red[ $error ]$reset Package '$2' not found.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
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
|
if [ "$?" != "0" ]; then
|
||||||
printf "$red[ $error ]$reset Package checksum not found.\n"
|
printf "$red[ $error ]$reset Package checksum not found.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
int_check() {
|
int_check() {
|
||||||
if [ "$GLACIER_DO_INT_CHECK" = "true" ]; then
|
if [ "$GLACIER_DO_INT_CHECK" = "true" ]; then
|
||||||
printf "$blue[ i ]$reset Checking package integrity...\n"
|
printf "$blue[ i ]$reset Checking package integrity...\n"
|
||||||
@ -127,7 +133,7 @@ clear_cache() {
|
|||||||
#
|
#
|
||||||
|
|
||||||
debug_info() {
|
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"
|
printf ">> Checking for valid download backend...\n"
|
||||||
whereis wget
|
whereis wget
|
||||||
whereis curl
|
whereis curl
|
||||||
@ -222,10 +228,19 @@ post_hooks () {
|
|||||||
/etc/glacier/post-hooks
|
/etc/glacier/post-hooks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
search_for_local_pkg() {
|
||||||
|
printf "$blue[ i ]$reset Searching working directory for package $2...\n"
|
||||||
|
find $2.tar.gz
|
||||||
|
if [ "$?" != 0 ]; then
|
||||||
|
printf "$red[ $error ]$reset Package $2 not found.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
-h|--help)
|
-h|--help)
|
||||||
printf "$blue[ * ] Glacier - Manage installed packages on the system$reset\n"
|
printf "$blue[ * ] Glacier - Manage installed packages on the system$reset\n"
|
||||||
printf "usage: glacier [-f] [-u] [-x] [-q] [-c] [-ci] [-cc] [--debuginfo]\n"
|
printf "usage: glacier [-f] [-u] [-x] [-q] [-c] [-ci] [-cc] [-li] [--debuginfo]\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "$blue=== Information ===$reset\n"
|
printf "$blue=== Information ===$reset\n"
|
||||||
printf "glacier {-h/--help} - Show this message and exit\n"
|
printf "glacier {-h/--help} - Show this message and exit\n"
|
||||||
@ -239,6 +254,7 @@ case $1 in
|
|||||||
printf "glacier {-c/cache} - Download a package to the cache\n"
|
printf "glacier {-c/cache} - Download a package to the cache\n"
|
||||||
printf "glacier {-ci/cache-install} - Install a package from the cache\n"
|
printf "glacier {-ci/cache-install} - Install a package from the cache\n"
|
||||||
printf "glacier {-cc/cache-clear} - Clear the cache\n"
|
printf "glacier {-cc/cache-clear} - Clear the cache\n"
|
||||||
|
printf "glacier {-li/local-install} - Install a package from a local directory\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf "$blue=== Debugging ===$reset\n"
|
printf "$blue=== Debugging ===$reset\n"
|
||||||
printf "glacier {--debuginfo} - Show debugging information\n"
|
printf "glacier {--debuginfo} - Show debugging information\n"
|
||||||
@ -250,12 +266,12 @@ case $1 in
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-v|--version)
|
-v|--version)
|
||||||
printf "${blue}Glacier v3.2.1${reset}\n"
|
printf "${blue}Glacier v3.3.0${reset}\n"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-f|install)
|
-f|install)
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Failed to commit to transaction - permission denied. Are you root?\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -287,7 +303,7 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
-u|update)
|
-u|update)
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Failed to commit to transaction - permission denied. Are you root?\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -319,7 +335,7 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
-x|remove)
|
-x|remove)
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Failed to commit to transaction - permission denied. Are you root?\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -356,7 +372,7 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
-c|cache)
|
-c|cache)
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Failed to commit to transaction - permission denied. Are you root?\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -382,7 +398,7 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
-ci|cache-install)
|
-ci|cache-install)
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Failed to commit to transaction - permission denied. Are you root?\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -414,7 +430,7 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
-cc|cache-clear)
|
-cc|cache-clear)
|
||||||
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
printf "$red[ $error ]$reset Please run Glacier as root.\n"
|
printf "$red[ $error ]$reset Failed to commit to transaction - permission denied. Are you root?\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -422,6 +438,40 @@ case $1 in
|
|||||||
printf "$green[ $check ]$reset Operation completed.\n"
|
printf "$green[ $check ]$reset Operation completed.\n"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
-li|local-install)
|
||||||
|
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
|
||||||
|
printf "$red[ $error ]$reset Failed to commit to transaction - permission denied. Are you root?\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$2" == "" ]; then
|
||||||
|
printf "$red[ $error ]$reset No package name was supplied.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
search_for_local_pkg "$@"
|
||||||
|
|
||||||
|
printf "$blue[ i ]$reset Installing package '$2' from local file.\n"
|
||||||
|
read -p "$(printf "$blue[ ? ]$reset Proceed with this operation? (y/n) ")" -n 1 -r
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
cp $2.tar.gz /opt/glacier/workspace
|
||||||
|
cd /opt/glacier/workspace
|
||||||
|
printf "\n"
|
||||||
|
pre_hooks "$@"
|
||||||
|
unpack_pkg "$@"
|
||||||
|
pre_op_hooks "$@"
|
||||||
|
installpkg "$@"
|
||||||
|
post_hooks "$@"
|
||||||
|
cleanup_keep_rm "$@"
|
||||||
|
printf "$green[ $check ]$reset Operation completed.\n"
|
||||||
|
exit 0
|
||||||
|
elif [[ $REPLY =~ ^[Nn]$ ]]; then
|
||||||
|
printf "\n"
|
||||||
|
printf "$red[ $error ]$reset Aborting.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
--debuginfo)
|
--debuginfo)
|
||||||
debug_info "$@"
|
debug_info "$@"
|
||||||
exit 0
|
exit 0
|
||||||
|
5
src/glacier-v4/glacier4
Executable file
5
src/glacier-v4/glacier4
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /etc/glacier/hooks
|
||||||
|
|
||||||
|
get_pkg()
|
8
src/glacier-v4/input-test
Executable file
8
src/glacier-v4/input-test
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /etc/glacier/hooks
|
||||||
|
|
||||||
|
for r in ${ALLOWED_REPOS[@]}; do
|
||||||
|
DOWNLOAD_REPO(1 2 3 4 5 6 7 8)=$GREPO/$r
|
||||||
|
echo $DOWNLOAD_REPO
|
||||||
|
done
|
8
src/glacier-v4/input-test-2
Executable file
8
src/glacier-v4/input-test-2
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
. /etc/glacier/hooks
|
||||||
|
|
||||||
|
for r in ${ALLOWED_REPOS[@]}; do
|
||||||
|
set REPO${ALLOWED_REPOS[@]}=$GREPO/${r}
|
||||||
|
echo ${REPO}${ALLOWED_REPOS[@]}
|
||||||
|
done
|
5
src/glacier-v4/input-test-3
Executable file
5
src/glacier-v4/input-test-3
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
for i; do
|
||||||
|
echo $1
|
||||||
|
done
|
@ -3,31 +3,10 @@
|
|||||||
# For more information on each of these options, see https://git.everest
|
# For more information on each of these options, see https://git.everest
|
||||||
#
|
#
|
||||||
|
|
||||||
# Repositories Glacier will use
|
# Repository Glacier will download programs from
|
||||||
|
|
||||||
#[world]
|
export GREPO="https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main"
|
||||||
export GREPO1="https://git.everestlinux.org/EverestLinux/glacier-pkgs/raw/branch/main/world" # System Software
|
export ALLOWED_REPOS=("world" "galaxy" "universe" "multiverse")
|
||||||
|
|
||||||
#[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
|
|
||||||
|
|
||||||
# Define colors and unicode symbols to be used
|
# Define colors and unicode symbols to be used
|
||||||
export red="\033[1;31m"
|
export red="\033[1;31m"
|
||||||
@ -47,8 +26,8 @@
|
|||||||
#export GLACIER_DOWNLOAD_BACKEND="aria2c"
|
#export GLACIER_DOWNLOAD_BACKEND="aria2c"
|
||||||
|
|
||||||
# Enable/disable package integrity checking
|
# Enable/disable package integrity checking
|
||||||
# This option requires Python to be installed
|
|
||||||
# WARNING: Keeping this enabled is strongly recommended.
|
# WARNING: Keeping this enabled is strongly recommended.
|
||||||
|
# This option ensures all packages from the repositories are genuine.
|
||||||
|
|
||||||
export GLACIER_DO_INT_CHECK="true"
|
export GLACIER_DO_INT_CHECK="true"
|
||||||
|
|
||||||
|
5
src/test/array-test.sh
Normal file
5
src/test/array-test.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
array=("world" "galaxy" "universe" "multiverse")
|
||||||
|
|
||||||
|
for i in "${array[@]}"; do
|
||||||
|
echo "$i"
|
||||||
|
done
|
37
src/test/glacier.conf
Executable file
37
src/test/glacier.conf
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
# /etc/glacier.conf
|
||||||
|
# The settings stored in this file will be loaded when Glacier is called
|
||||||
|
# For more information on each of these options, see https://git.everest
|
||||||
|
#
|
||||||
|
|
||||||
|
# Repository Glacier will download programs from
|
||||||
|
|
||||||
|
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"
|
||||||
|
export green="\033[1;32m"
|
||||||
|
export yellow="\033[1;33m"
|
||||||
|
export blue="\033[1;34m"
|
||||||
|
export reset="\033[m"
|
||||||
|
export check="\xE2\x9C\x93"
|
||||||
|
export error="\xE2\x9C\x95"
|
||||||
|
export warning="\x21"
|
||||||
|
export question="\x3F"
|
||||||
|
|
||||||
|
# Which backend Glacier will use to download files
|
||||||
|
# Selecting more than one backend will cause breakage
|
||||||
|
export GLACIER_DOWNLOAD_BACKEND="wget --quiet --show-progress"
|
||||||
|
#export GLACIER_DOWNLOAD_BACKEND="curl --output $2.tar.gz"
|
||||||
|
#export GLACIER_DOWNLOAD_BACKEND="aria2c"
|
||||||
|
|
||||||
|
# Enable/disable package integrity checking
|
||||||
|
# WARNING: Keeping this enabled is strongly recommended.
|
||||||
|
# This option ensures all packages from the repositories are genuine.
|
||||||
|
|
||||||
|
export GLACIER_DO_INT_CHECK="true"
|
||||||
|
|
||||||
|
#
|
||||||
|
# end /etc/glacier.conf
|
||||||
|
#
|
||||||
|
|
@ -1,33 +1,64 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Glacier - manage installed packages on a Linux system
|
# 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,
|
# This file is part of Glacier.
|
||||||
# or at your option, any later version.
|
#
|
||||||
|
# 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
|
# You should have received a copy of the GNU General Public License
|
||||||
# recieved along with this program. If not, see
|
# along with Glacier. If not, see <https://www.gnu.org/licenses/>.
|
||||||
# <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() {
|
get_pkg() {
|
||||||
printf "$blue[ i ]$reset Downloading archive for package '$2'...\n"
|
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
|
for r in ${ALLOWED_REPOS[@]}; do
|
||||||
|
$GLACIER_DOWNLOAD_BACKEND $GREPO/${r}/$2.tar.gz
|
||||||
|
done
|
||||||
|
find $2.tar.gz
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
printf "$red[ $error ]$reset Package '$2' not found.\n"
|
printf "$red[ $error ]$reset Package '$2' not found.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
|
||||||
|
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
|
if [ "$?" != "0" ]; then
|
||||||
printf "$red[ $error ]$reset Package checksum not found.\n"
|
printf "$red[ $error ]$reset Package checksum not found.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
int_check() {
|
int_check() {
|
||||||
if [ "$GLACIER_DO_INT_CHECK" = "true" ]; then
|
if [ "$GLACIER_DO_INT_CHECK" = "true" ]; then
|
||||||
printf "$blue[ i ]$reset Checking package integrity...\n"
|
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
|
if [ "$?" != "0" ]; then
|
||||||
printf "$red[ $error ]$reset Integrity check failed.\n"
|
printf "$red[ $error ]$reset Integrity check failed.\n"
|
||||||
exit 1
|
exit 1
|
||||||
@ -41,7 +72,7 @@ int_check() {
|
|||||||
unpack_pkg() {
|
unpack_pkg() {
|
||||||
printf "$blue[ i ]$reset Unpacking $2.tar.gz...\n"
|
printf "$blue[ i ]$reset Unpacking $2.tar.gz...\n"
|
||||||
mkdir $2 && mv $2.tar.gz $2 && cd $2
|
mkdir $2 && mv $2.tar.gz $2 && cd $2
|
||||||
tar -xf $2.tar.gz
|
pv $2.tar.gz | tar -xz
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
printf "$red[ $error ]$reset Could not unpack $2.tar.gz.\n"
|
printf "$red[ $error ]$reset Could not unpack $2.tar.gz.\n"
|
||||||
cd .. && rm -rf $2
|
cd .. && rm -rf $2
|
||||||
@ -117,7 +148,7 @@ clear_cache() {
|
|||||||
#
|
#
|
||||||
|
|
||||||
debug_info() {
|
debug_info() {
|
||||||
printf "$blue>> Glacier v3.2.0$reset\n"
|
printf "$blue>> Glacier v3.3.0$reset\n"
|
||||||
printf ">> Checking for valid download backend...\n"
|
printf ">> Checking for valid download backend...\n"
|
||||||
whereis wget
|
whereis wget
|
||||||
whereis curl
|
whereis curl
|
||||||
@ -240,7 +271,7 @@ case $1 in
|
|||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-v|--version)
|
-v|--version)
|
||||||
printf "${blue}Glacier v3.2.0${reset}\n"
|
printf "${blue}Glacier v3.3.0${reset}\n"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
-f|install)
|
-f|install)
|
5
src/test/hooks-test
Executable file
5
src/test/hooks-test
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Glacier Preloading Hooks
|
||||||
|
|
||||||
|
source /etc/make.conf
|
||||||
|
source $(pwd)/glacier.conf
|
Loading…
Reference in New Issue
Block a user