Glacier v3.0.1 - Post-operation hooks added

This commit is contained in:
lw-everestlinux 2022-10-26 12:14:23 -04:00
parent 65c2ad8146
commit f6fce7323d
3 changed files with 17 additions and 2 deletions

View File

@ -38,6 +38,7 @@ mkdir /etc/glacier
mkdir /etc/glacier/pkginfo mkdir /etc/glacier/pkginfo
mv $SRC_DIR/hooks $CONFDIR/glacier mv $SRC_DIR/hooks $CONFDIR/glacier
mv $SRC_DIR/post-hooks $CONFDIR/glacier
mv $SRC_DIR/hooks.sh $CONFDIR/glacier mv $SRC_DIR/hooks.sh $CONFDIR/glacier
mv $SRC_DIR/make.conf $CONFDIR mv $SRC_DIR/make.conf $CONFDIR

View File

@ -108,7 +108,7 @@ clear_cache() {
} }
debug_info() { debug_info() {
printf "$blue>> Glacier v3.0.0$reset\n" printf "$blue>> Glacier v3.0.1$reset\n"
printf ">> Checking for valid download backend...\n" printf ">> Checking for valid download backend...\n"
whereis wget whereis wget
whereis curl whereis curl
@ -163,6 +163,11 @@ cleanup () {
cd .. && rm -rf $2 cd .. && rm -rf $2
} }
post_hooks () {
printf "$blue[ i ]$reset Executing post-operation hooks...\n"
/etc/glacier/post-hooks
}
case $1 in case $1 in
-h|--help) -h|--help)
printf "Glacier - Manage installed packages on the system\n" printf "Glacier - Manage installed packages on the system\n"
@ -191,7 +196,7 @@ case $1 in
exit 0 exit 0
;; ;;
-v|--version) -v|--version)
printf "$blue Glacier v3.0.0$reset\n" printf "$blue Glacier v3.0.1$reset\n"
exit 0 exit 0
;; ;;
-f|-install) -f|-install)
@ -209,6 +214,7 @@ case $1 in
#int_check # Will implement this later on #int_check # Will implement this later on
unpack_pkg "$@" unpack_pkg "$@"
installpkg "$@" installpkg "$@"
post_hooks "$@"
cleanup "$@" cleanup "$@"
printf "$green[ $check ]$reset Operation completed.\n" printf "$green[ $check ]$reset Operation completed.\n"
exit 0 exit 0
@ -229,6 +235,7 @@ case $1 in
#int_check #int_check
unpack_pkg "$@" unpack_pkg "$@"
updatepkg "$@" updatepkg "$@"
post_hooks "$@"
cleanup "$@" cleanup "$@"
printf "$green[ $check ]$reset Operation completed.\n" printf "$green[ $check ]$reset Operation completed.\n"
exit 0 exit 0
@ -249,6 +256,7 @@ case $1 in
#int_check #int_check
unpack_pkg "$@" unpack_pkg "$@"
removepkg "$@" removepkg "$@"
post_hooks "$@"
cleanup "$@" cleanup "$@"
printf "$green[ $check ]$reset Operation completed.\n" printf "$green[ $check ]$reset Operation completed.\n"
exit 0 exit 0
@ -289,6 +297,7 @@ case $1 in
printf "\n" printf "\n"
unpack_pkg "$@" unpack_pkg "$@"
installpkg "$@" installpkg "$@"
post_hooks "$@"
cleanup "$@" cleanup "$@"
printf "$green[ $check ]$reset Operation completed.\n" printf "$green[ $check ]$reset Operation completed.\n"
exit 0 exit 0

5
src/post-hooks Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Glacier post-operation hooks
printf "No hooks to be executed.\n"
exit 1