From 61daa251a77df891fb1e153632d837a367108b7e Mon Sep 17 00:00:00 2001 From: Liam Waldron Date: Sun, 13 Aug 2023 16:38:36 +0000 Subject: [PATCH] progress as of 8/13/23 --- src/man/glacier-tutorial.1 | 39 ++++++++++++++++++++++++++++++++++ src/services/update-pkgdb.hook | 32 ++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/man/glacier-tutorial.1 create mode 100755 src/services/update-pkgdb.hook diff --git a/src/man/glacier-tutorial.1 b/src/man/glacier-tutorial.1 new file mode 100644 index 0000000..7320cf5 --- /dev/null +++ b/src/man/glacier-tutorial.1 @@ -0,0 +1,39 @@ +.\" Glacier tutorial manpage. +.TH man 1 "13 August 2023" "4.0" "Glacier Manual" +Glacier \- Package management system for Everest Linux +.SH INTRODUCTION +Glacier is the package management system designed for Everest Linux. Its main inspiration was Portage from Gentoo, taking further inspiration from Arch Linux's makepkg. + +A list of all installed programs, called the index, is stored on the system. Glacier can then interact with this index. +.SH INCLUDED PROGRAMS +.TP +.BR gpkg(8) +Make changes to the local index +.TP +.BR syspkg(8) +Make changes to the system-wide index +.TP +.BR gquery(1) +Query information on a specific package +.TP +.BR glist(1) +List packages from an index +.TP +.BR gpc(1) +Check a package for syntax errors +.TP +.BR glacier-mkprofile(8) +Create a system-wide profile +.TP +.BR glacier-update-pkgdb(8) +Sync the local package database with the global server +.TP +.BR glacierg(8) +TUI able to merge, update, and remove packages +.SH TERMINOLOGY +This section covers basic terminology pertaining to Glacier. + +The package index is a directory containing the package files for all packages installed by a user. The index is split into the user index, and the system index. The user index is located under /usr/glacier/index, and is intended for use by unprivileged users. On the other hand, the system index, located under /glacier/index, is managed by Git. It should not be modified under normal circumstances. + +The system profile describes your base system, including the C library the system image was shipped with, which architecture it was compiled for, and whether SELinux and/or multilib support were enabled. Although Glacier includes a system for managing this, it should not be under normal circumstances. +.SH diff --git a/src/services/update-pkgdb.hook b/src/services/update-pkgdb.hook new file mode 100755 index 0000000..9cff82e --- /dev/null +++ b/src/services/update-pkgdb.hook @@ -0,0 +1,32 @@ +#!/bin/bash + +# SERVICE NAME: update-pkgdb +# SERVICE DESCRIPTION: Update the local package database + +if [ "${GLACIER_ALLOW_SERVICES}" != "true" ]; then + printf "${red}[${error}]${reset} Glacier services are disabled.\n" + printf "${red}[${error}]${reset} Enable services by setting 'GLACIER_ALLOW_SERVICES' in /etc/glacier.conf to 'true'.\n" + printf "${red}[${error}]${reset} Services may pose a security risk to your system. Only use services from trusted users.\n" + exit 1 +fi + +ROOT_URL="https://git.everestlinux.org/EverestLinux" +MV_TO_DB="cd /usr/glacier/epkgs" + +printf "${blue}[*]${reset} Updating system profile...\n" +source /etc/glacier/profile.conf +printf "${blue}[i]${reset} Using profile ${GLACIER_SYSTEM_PROFILE}.\n" +${MV_TO_DB}-${GLACIER_SYSTEM_PROFILE} + if [ "$?" != 0 ]; then + printf "${red}[${error}]${reset} Local package database does not exist.\n" + printf "${red}[${error}]${reset} Correct this by running:\n" + printf "${red}[${error}]${reset} 'mkdir /usr/glacier/epkgs-${GLACIER_SYSTEM_PROFILE} && glacier-update-pkgdb\n" + exit 1 + fi +git pull + if [ "$?" != 0 ]; then + printf "${red}[${error}]${reset} Error while updating database.\n" + exit 1 + fi +printf "${green}[${check}]${reset} Package database updated successfully.\n" +exit 0