initial commit

This commit is contained in:
lw-everestlinux
2022-09-07 13:06:48 -04:00
commit 4e754c2f22
6 changed files with 845 additions and 0 deletions

67
src/glacier Executable file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
# Glacier Package Manager - v3.0
# Preloading
/usr/bin/gscripts preload
source $input
# Main Script
while [[ $# -gt 0 ]]; do
case $1 in
-h|--help)
printf "$blue [ * ] Glacier - A source based package manager written in POSIX sh [ * ] $reset\n"
printf "$blue=== Information ====================================================================================$reset\n"
printf "$ glacier {-h --help} show this message and exit\n"
printf "$ glacier {--version} display the current Glacier version and exit\n"
printf "$blue=== Package Operations =============================================================================$reset\n"
printf "# glacier {install -f} install a package\n"
printf "# glacier {update -u} update a package\n"
printf "# glacier {remove -x} remove a package\n"
printf "$ glacier {query -q} query a package\n"
printf "# glacier {cache -c} cache a package\n"
printf "# glacier {cache-install -ci} install a cached package\n"
printf "# glacier {cache-clear -cc} clear the package cache\n"
printf "$blue=== Debugging ======================================================================================$reset\n"
printf "$ glacier {--showDebugInfo} show debugging info\n"
printf "$blue=== Licensing ======================================================================================$reset\n"
printf "This program is freely distributable under the terms of the GNU General Public License version 3 or later.\n"
printf "You should have recieved a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.\n"
printf "======================================================================================================\n"
exit 0
;;
--version)
printf "$blue Glacier v3.0$reset\n"
exit 0
;;
install|-f)
# Require script to be run as root
if [[ $(/usr/bin/id -u) -ne 0 ]]; then
$GLACIER_ERROR_NO_ROOT
exit 1
fi
$GLACIER_WHICH_PKG && read input
$GLACIER_STATUS_INSTALLING
/usr/bin/gscripts download
if [ "$?" != "0" ]; then
$GLACIER_ERROR_DOES_NOT_EXIST
exit 1
fi
$GLACIER_STATUS_INTEGRITY_CHECK
mkdir $input && mv $input.tar.gz $input && cd $input
/usr/bin/gscripts integrity-check
if [ "$?" != "0" ]; then
exit 1
fi
tar -xvf $input.tar.gz
if [ "$?" != "0" ]; then
$GLACIER_ERROR_CANNOT_UNPACK
exit 1
fi
chmod +x INSTALL.sh
chmod +x $input.ts.sh
$GLACIER_STATUS_EXECUTING
./install.sh
/usr/bin/gscripts post-install
esac
done