From 2ea5c8a8099bf45310b46459446ebd72570b1fe6 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 16:28:01 +0200 Subject: [PATCH 1/5] add confirm --- aps | 14 ++++++++++++++ install.sh | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/aps b/aps index 3e4fb51..9408086 100755 --- a/aps +++ b/aps @@ -14,6 +14,16 @@ die() { rm "${lock}" exit 2 } +confirm(){ + echo -ne "Are you sure? [Y/n] " + read prompt + if [[ $prompt = [nN] ]]; then + die "[E] User said no. Exiting..." + elif [[ $prompt = [yY] ]]; then + else + die "[E] User gave invalid input. Exiting..." + fi +} run_package_script() { { if [ -x "${2}/${1}" ]; then @@ -26,6 +36,7 @@ run_package_script() { install_local_package() { [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." # Extract the package + confirm echo ":: Installing package ${1}" cp -prv "${1}" "${temp_location}" pkg_name="${1%/}" @@ -73,6 +84,7 @@ install_local_package() { echo "[*] Install complete for package ${pkg_name}" } sync_deps(){ + confirm echo ":: Syncing dependencies for ${1}" install_package_from_repo "${pkg_makedepends}" install_package_from_repo "${pkg_deps}" @@ -80,6 +92,7 @@ sync_deps(){ } remove_local_package() { + confirm echo ":: Removing target ${1}..." pkg_path="${installed_pkg_database}/${1}" [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." @@ -106,6 +119,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ install_local_package "${locpkg_database}/${1}/${2}" } upgrade() { + confirm echo ":: Upgrading installed packages" cd "${installed_pkg_database}" || die "Could not enter local installed package database directory. Exiting..." for pkg in */; do diff --git a/install.sh b/install.sh index 31ad99d..0494266 100755 --- a/install.sh +++ b/install.sh @@ -13,9 +13,9 @@ if [ ${prefix} == / ]; then kill 2 fi else + ./aps sync alnux install -v aps ${prefix}/usr/bin/ && install -v altools/sel ${prefix}/usr/bin/ && - install -v altools/repo ${prefix}/usr/bin/ && - ${prefix}/usr/bin/aps sync alnux && - install -v config/config /etc/al + install -v altools/repo ${prefix}/usr/bin/ && + install -v config/config ${prefix}/etc/al fi -- 2.30.2 From 64de631b3f66e90c076062b7f2d0a7b84b51d943 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Thu, 26 Aug 2021 12:13:29 +0200 Subject: [PATCH 2/5] add a suite of things --- aps | 33 ++++++++++++++++++++++++++++----- config/config | 3 ++- install.sh | 3 ++- man/aps.8.gz | Bin 0 -> 422 bytes settings | 9 +++++++++ 5 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 man/aps.8.gz create mode 100644 settings diff --git a/aps b/aps index 9408086..d3b9d62 100755 --- a/aps +++ b/aps @@ -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 - else - die "[E] User gave invalid input. Exiting..." + if [[ ${prompt} = [nN] ]]; then + die "User said no. Exiting..." + elif [[ ${prompt} = [yY] ]]; then + else + 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}" diff --git a/config/config b/config/config index c4db539..fd2aaf1 100755 --- a/config/config +++ b/config/config @@ -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 diff --git a/install.sh b/install.sh index 0494266..018a348 100755 --- a/install.sh +++ b/install.sh @@ -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 diff --git a/man/aps.8.gz b/man/aps.8.gz new file mode 100644 index 0000000000000000000000000000000000000000..974d26dac1e6ab8e84c55a39b6cf54ee5327a52a GIT binary patch literal 422 zcmV;X0a^YZiwFoHX(wR-17UD;E;s8x{acB=!^O_89l_6h z82blk@ay#r9F6vc7VgDJ`l4JK#wle-)`q22lTV{n$;Q8UCb+XBbDex5WOcxC_n3(o zsCgG9W~Et?3gvI{SOZ645#viHO)2yb&vUa<+GB zWE4l@Vj`z6*VoZH@`V`M!4H8pOPcn&QbOkCO1Ln|vK0QjJX=3-a)v>*EqRY%SLCEA Q(CSP40-jC>R=NWK089(cO8@`> literal 0 HcmV?d00001 diff --git a/settings b/settings new file mode 100644 index 0000000..64a9aa3 --- /dev/null +++ b/settings @@ -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 -- 2.30.2 From 3967b897df9bd0d89b482ce47758eb0d0b036a42 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Thu, 26 Aug 2021 15:03:00 +0200 Subject: [PATCH 3/5] trolld --- aps | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aps b/aps index d3b9d62..f7f5999 100755 --- a/aps +++ b/aps @@ -14,7 +14,7 @@ else locpkg_database="${install_root}/var/aps/repos" lock="${install_root}/var/aps/lock" official="https://git.hippoz.xyz/alnux/repo" - debug=off + debug=off fi if [ ${debug} = on ]; then set -x @@ -29,8 +29,7 @@ confirm(){ read prompt if [[ ${prompt} = [nN] ]]; then die "User said no. Exiting..." - elif [[ ${prompt} = [yY] ]]; then - else + elif [[ ${prompt} != [yY] ]]; then die "User gave invalid input. Exiting..." fi } -- 2.30.2 From c540598726ffe10b3f3768ab7c305afae23aae21 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Thu, 26 Aug 2021 15:17:56 +0200 Subject: [PATCH 4/5] g --- aps | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aps b/aps index f7f5999..7b5ce11 100755 --- a/aps +++ b/aps @@ -156,9 +156,9 @@ 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 "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)" + echo "remove - Removes a package from /var/aps/installed and it's install files (payloadfiles)." } main() { if [ -f "${lock}" ]; then -- 2.30.2 From 61bcf710c0bfe713ad55ac978ad8e07d62a9752a Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Thu, 26 Aug 2021 15:30:41 +0200 Subject: [PATCH 5/5] uhh --- settings | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 settings diff --git a/settings b/settings deleted file mode 100644 index 64a9aa3..0000000 --- a/settings +++ /dev/null @@ -1,9 +0,0 @@ -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 -- 2.30.2