add debug and confirm #9

Merged
hippoz merged 5 commits from Ohio2/aps:master into master 2021-08-26 16:31:30 +03:00
5 changed files with 41 additions and 7 deletions
Showing only changes of commit 64de631b3f - Show all commits

31
aps
View file

@ -1,4 +1,10 @@
#!/bin/sh
#################################
# Alnux Packaging System, #
# the package manager for Alnux #
#################################
if [ -f "/etc/al/config" ]; then
. /etc/al/config
else
@ -8,6 +14,10 @@ else
locpkg_database="${install_root}/var/aps/repos"
lock="${install_root}/var/aps/lock"
official="https://git.hippoz.xyz/alnux/repo"
debug=off
fi
if [ ${debug} = on ]; then
set -x
fi
die() {
echo "aps: fatal: ${1}"
@ -17,11 +27,11 @@ die() {
confirm(){
echo -ne "Are you sure? [Y/n] "
read prompt
if [[ $prompt = [nN] ]]; then
die "[E] User said no. Exiting..."
elif [[ $prompt = [yY] ]]; then
if [[ ${prompt} = [nN] ]]; then
die "User said no. Exiting..."
elif [[ ${prompt} = [yY] ]]; then
else
die "[E] User gave invalid input. Exiting..."
die "User gave invalid input. Exiting..."
fi
}
run_package_script() {
@ -140,6 +150,17 @@ upgrade() {
unset pkg_config_depends
done
}
version(){
echo "Alnux APS v0.0.8"
}
help(){
echo "Alnux APS, the packaging system for Alnux."
echo ""
echo "sync - Synchronizes from package repository."
echo "install - Installs from local package information file and build file"
echo "upgrade - Upgrades from package repository."
echo "remove - Removes a package from /var/aps/installed and it's install files (payloadfiles)"
}
main() {
if [ -f "${lock}" ]; then
echo "[E] A lock file already exists (another instance of the package manager could be running). If you're sure no package manager is running, remove the file ${lock}."
@ -158,6 +179,8 @@ main() {
[ -z "${2}" ] && exit 0
install_package_from_repo "official" "${2}" ;;
upgrade) upgrade "official" ;;
help) help ;;
version) version ;;
*) die "[E] Invalid option ${1}, exiting..." ;;
esac
rm "${lock}"

View file

@ -4,8 +4,9 @@
# Alnux Packaging System #
##########################
temp_location="/var/tmp"
install_root="/var/tmp/alroot"
install_root="/"
installed_pkg_database="${install_root}/var/aps/installed"
locpkg_database="${install_root}/var/aps/repos"
lock="${install_root}/var/aps/lock"
official="https://git.hippoz.xyz/alnux/repo"
debug=off

View file

@ -17,5 +17,6 @@ else
install -v aps ${prefix}/usr/bin/ &&
install -v altools/sel ${prefix}/usr/bin/ &&
install -v altools/repo ${prefix}/usr/bin/ &&
install -v config/config ${prefix}/etc/al
install -v config/config ${prefix}/etc/al &&
install -v -Dm644 man/aps.8.gz ${prefix}/usr/share/man/man8/
fi

BIN
man/aps.8.gz Normal file

Binary file not shown.

9
settings Normal file
View file

@ -0,0 +1,9 @@
UnlockClient=true
UnlockStudio=false
FPSCapValues=[30.000000, 60.000000, 75.000000, 120.000000, 144.000000, 165.000000, 240.000000, 360.000000]
FPSCapSelection=0
FPSCap=0.000000
CheckForUpdates=true
NonBlockingErrors=true
SilentErrors=false
QuickStart=false