From 1ef353862d79484c40af85c7370b476f38d3466a Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Tue, 24 Aug 2021 06:55:14 +0200 Subject: [PATCH 1/9] add the sel(ect) utility --- altools/sel | 25 +++++++++++++++++++++++++ aps | 7 +++++++ 2 files changed, 32 insertions(+) create mode 100755 altools/sel diff --git a/altools/sel b/altools/sel new file mode 100755 index 0000000..12217c4 --- /dev/null +++ b/altools/sel @@ -0,0 +1,25 @@ +#!/bin/sh + +######################### +# Alnux sel(ect) Script # +######################### +. "/etc/al/lnver.v" +case $1 in + linux) case $2 in + list) ls /usr/src/ | grep 'linux' && + ls -L /usr/src/linux 2>/dev/null + ;; + set) lnver=${3} > /etc/al/lnver.v + ;; + link) ln -sv /usr/src/linux-${lnver} /usr/src/linux && + mkdir -pv /var/aps/packages/linux/ && + echo "/boot/vmlinuz-linux-${lnver}" > /var/aps/packages/linux/payloadfiles && + echo "/usr/src/${lnver}" >> /var/aps/packages/linux/payloadfiles && + echo "pkg_config_deploy=true" > /var/aps/packages/linux/package && + echo "pkg_config_ver='${lnver}'" >> /var/aps/packages/linux/package && + echo "pkg_config_name='linux'" >> /var/aps/packages/linux/package && + echo "pkg_config_makedepends=''" >> /var/aps/packages/linux/package && + echo "pkg_config_depends=''" >> /var/aps/packages/linux/package + ;; + esac +esac diff --git a/aps b/aps index 6112af2..8766e86 100644 --- a/aps +++ b/aps @@ -68,6 +68,13 @@ install_local_package() { unset pkg_config_depends echo "[*] Install complete for package ${pkg_name}" } +sync_deps(){ + echo ":: Syncing dependencies for ${1}" + install_package_from_repo "${pkg_makedepends}" + install_package_from_repo "${pkg_deps}" + echo "[*] Install dependencies for ${1}" + +} remove_local_package() { echo ":: Removing target ${1}..." pkg_path="${installed_pkg_database}/${1}" From 6510fd413243471f4b33762354d8d681297274ce Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Tue, 24 Aug 2021 07:32:32 +0200 Subject: [PATCH 2/9] Add repo and install.sh --- altools/repo | 13 +++++++++++++ altools/sel | 4 +++- aps | 0 install.sh | 18 ++++++++++++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 altools/repo mode change 100644 => 100755 aps create mode 100755 install.sh diff --git a/altools/repo b/altools/repo new file mode 100644 index 0000000..3e8aa26 --- /dev/null +++ b/altools/repo @@ -0,0 +1,13 @@ +#!/bin/sh + +######################################## +# Repo, a repository manager for alnux # +######################################## +if [ $(whoami) != root ]; then + echo "[E] Run as root!" + kill 2 +else + case $1 in + add) git clone https://${3}/${2}.git /var/aps/repos/${2} ;; + esac +fi diff --git a/altools/sel b/altools/sel index 12217c4..b159cf1 100755 --- a/altools/sel +++ b/altools/sel @@ -5,7 +5,8 @@ ######################### . "/etc/al/lnver.v" case $1 in - linux) case $2 in + linux) if [ $(whoami) != root ]; then + case $2 in list) ls /usr/src/ | grep 'linux' && ls -L /usr/src/linux 2>/dev/null ;; @@ -22,4 +23,5 @@ case $1 in echo "pkg_config_depends=''" >> /var/aps/packages/linux/package ;; esac + fi esac diff --git a/aps b/aps old mode 100644 new mode 100755 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..830394d --- /dev/null +++ b/install.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +########################## +# INSTALL SCRIPT FOR APS # +########################## +case $1 in + --prefix) prefix=$2 ;; + *) prefix=/ +esac +if [ ${prefix} == / ]; then + if [ $(whoami) != root ]; then + echo '[E] You must run as root!' + kill 2 + fi +else + install -v aps ${prefix}/usr/bin/ && + install -v altools/sel ${prefix}/usr/bin/ +fi From ed2c91660988d2654d4d6512992797eb4bec740c Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Tue, 24 Aug 2021 06:37:30 +0100 Subject: [PATCH 3/9] =?UTF-8?q?i=20forgor=20=F0=9F=92=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 830394d..d983dd1 100755 --- a/install.sh +++ b/install.sh @@ -14,5 +14,6 @@ if [ ${prefix} == / ]; then fi else install -v aps ${prefix}/usr/bin/ && - install -v altools/sel ${prefix}/usr/bin/ + install -v altools/sel ${prefix}/usr/bin/ && + install -v altools/repo ${prefix}/usr/bin/ fi From f473df35b66ee5dd4581f68deb4c11729add6942 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 11:37:56 +0200 Subject: [PATCH 4/9] lmfao --- altools/repo | 10 +++++++++- altools/sel | 10 ++++++++-- install.sh | 6 ++++-- 3 files changed, 21 insertions(+), 5 deletions(-) mode change 100644 => 100755 altools/repo diff --git a/altools/repo b/altools/repo old mode 100644 new mode 100755 index 3e8aa26..1786f74 --- a/altools/repo +++ b/altools/repo @@ -8,6 +8,14 @@ if [ $(whoami) != root ]; then kill 2 else case $1 in - add) git clone https://${3}/${2}.git /var/aps/repos/${2} ;; + # add a repo + add) git clone https://${3}/${2}.git /var/aps/repos/${2} + echo "${2}" >> /etc/al/repo.conf + ;; + # update a repo + update) pushd && cd /var/aps/repos/${2} && git pull && popd ;; + # destroy a repo (remove) + destroy) rm -rfv /var/aps/repos/${2} ;; + esac fi diff --git a/altools/sel b/altools/sel index b159cf1..3994ea3 100755 --- a/altools/sel +++ b/altools/sel @@ -3,15 +3,18 @@ ######################### # Alnux sel(ect) Script # ######################### -. "/etc/al/lnver.v" +. "/etc/al/lnver.cfg" case $1 in linux) if [ $(whoami) != root ]; then case $2 in + # Lists all kernels list) ls /usr/src/ | grep 'linux' && ls -L /usr/src/linux 2>/dev/null ;; - set) lnver=${3} > /etc/al/lnver.v + # Sets a kernel version + set) lnver=${3} > /etc/al/lnver.cfg ;; + # Links the set kernel version. link) ln -sv /usr/src/linux-${lnver} /usr/src/linux && mkdir -pv /var/aps/packages/linux/ && echo "/boot/vmlinuz-linux-${lnver}" > /var/aps/packages/linux/payloadfiles && @@ -21,7 +24,10 @@ case $1 in echo "pkg_config_name='linux'" >> /var/aps/packages/linux/package && echo "pkg_config_makedepends=''" >> /var/aps/packages/linux/package && echo "pkg_config_depends=''" >> /var/aps/packages/linux/package + ;; + # Destroys the symlink. + destroy) rm -rfv /usr/src/linux ;; esac fi esac diff --git a/install.sh b/install.sh index 87d71e6..20ae0da 100755 --- a/install.sh +++ b/install.sh @@ -14,6 +14,8 @@ if [ ${prefix} == / ]; then fi else install -v aps ${prefix}/usr/bin/ && - install -v altools/sel ${prefix}/usr/bin/ - install -v altools/repo ${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 tools/* /usr/bin/ fi From 0eb142c4d62f7f1f9a62bb5988ce4e87daf7977d Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 11:43:35 +0200 Subject: [PATCH 5/9] remove whole line containing 123 when 123 is a package repo & its website is trololo.git/troll/repo --- altools/repo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/altools/repo b/altools/repo index 1786f74..fc5edf9 100755 --- a/altools/repo +++ b/altools/repo @@ -15,7 +15,9 @@ else # update a repo update) pushd && cd /var/aps/repos/${2} && git pull && popd ;; # destroy a repo (remove) - destroy) rm -rfv /var/aps/repos/${2} ;; + destroy) rm -rfv /var/aps/repos/${2} + sed -i "/^${2}/d" /etc/al/repo.conf + ;; esac fi From 4223978465d434bfbd839d9cba2654a2e33ab4ee Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 11:45:35 +0200 Subject: [PATCH 6/9] tools/ does not exist --- install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 20ae0da..f3c534f 100755 --- a/install.sh +++ b/install.sh @@ -16,6 +16,5 @@ else 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 tools/* /usr/bin/ + ${prefix}/usr/bin/aps sync alnux fi From b1ca212971685fb5464ebd4ff332b569e3c729a9 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 12:21:03 +0200 Subject: [PATCH 7/9] hippoz insisted on doing this so um --- altools/repo | 5 ----- settings | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 settings diff --git a/altools/repo b/altools/repo index fc5edf9..7cbf2ae 100755 --- a/altools/repo +++ b/altools/repo @@ -3,10 +3,6 @@ ######################################## # Repo, a repository manager for alnux # ######################################## -if [ $(whoami) != root ]; then - echo "[E] Run as root!" - kill 2 -else case $1 in # add a repo add) git clone https://${3}/${2}.git /var/aps/repos/${2} @@ -20,4 +16,3 @@ else ;; esac -fi 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 From 5bcb0d16071ee5598201e42dd57a2bd445f051fc Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 13:01:36 +0200 Subject: [PATCH 8/9] add config --- altools/repo | 24 ++++++++++++------------ altools/sel | 36 +++++++++++++++++++----------------- aps | 16 ++++++++++------ config/config | 11 +++++++++++ install.sh | 3 ++- 5 files changed, 54 insertions(+), 36 deletions(-) create mode 100755 config/config diff --git a/altools/repo b/altools/repo index 7cbf2ae..a854b9e 100755 --- a/altools/repo +++ b/altools/repo @@ -3,16 +3,16 @@ ######################################## # Repo, a repository manager for alnux # ######################################## - case $1 in - # add a repo - add) git clone https://${3}/${2}.git /var/aps/repos/${2} - echo "${2}" >> /etc/al/repo.conf - ;; - # update a repo - update) pushd && cd /var/aps/repos/${2} && git pull && popd ;; - # destroy a repo (remove) - destroy) rm -rfv /var/aps/repos/${2} - sed -i "/^${2}/d" /etc/al/repo.conf +. /etc/al/config +case $1 in + # add a repo + add) git clone https://${3}/${2}.git ${install_root}/var/aps/repos/${2} + echo "${2}" >> ${install_root}/etc/al/repo.conf ;; - - esac + # update a repo + update) pushd && cd ${install_root}/var/aps/repos/${2} && git pull && popd ;; + # destroy a repo (remove) + destroy) rm -rfv ${install_root}/var/aps/repos/${2} + sed -i "/^${2}/d" ${install_root}/etc/al/repo.conf + ;; +esac diff --git a/altools/sel b/altools/sel index 3994ea3..502a427 100755 --- a/altools/sel +++ b/altools/sel @@ -3,31 +3,33 @@ ######################### # Alnux sel(ect) Script # ######################### -. "/etc/al/lnver.cfg" +. /etc/al/config +if [ -f "${install_root}/etc/al/lnver" ]; then + . /etc/al/lnver.cfg +fi case $1 in - linux) if [ $(whoami) != root ]; then - case $2 in + linux) case $2 in # Lists all kernels - list) ls /usr/src/ | grep 'linux' && - ls -L /usr/src/linux 2>/dev/null + list) ls ${install_root}/usr/src/ | grep 'linux' && + ls -L ${install_root}/usr/src/linux 2>/dev/null ;; # Sets a kernel version - set) lnver=${3} > /etc/al/lnver.cfg + set) lnver=${3} + echo "lnver=${3}" > ${install_root}/etc/al/lnver.cfg ;; # Links the set kernel version. - link) ln -sv /usr/src/linux-${lnver} /usr/src/linux && - mkdir -pv /var/aps/packages/linux/ && - echo "/boot/vmlinuz-linux-${lnver}" > /var/aps/packages/linux/payloadfiles && - echo "/usr/src/${lnver}" >> /var/aps/packages/linux/payloadfiles && - echo "pkg_config_deploy=true" > /var/aps/packages/linux/package && - echo "pkg_config_ver='${lnver}'" >> /var/aps/packages/linux/package && - echo "pkg_config_name='linux'" >> /var/aps/packages/linux/package && - echo "pkg_config_makedepends=''" >> /var/aps/packages/linux/package && - echo "pkg_config_depends=''" >> /var/aps/packages/linux/package + link) ln -sv ${install_root}/usr/src/linux-${lnver} ${install_root}/usr/src/linux && + mkdir -pv ${install_root}/var/aps/packages/linux/ && + echo "/boot/vmlinuz-linux-${lnver}" > ${install_root}/var/aps/packages/linux/payloadfiles && + echo "/usr/src/${lnver}" >> ${install_root}/var/aps/packages/linux/payloadfiles && + echo "pkg_config_deploy=true" > ${install_root}/var/aps/packages/linux/package && + echo "pkg_config_ver='${lnver}'" >> ${install_root}/var/aps/packages/linux/package && + echo "pkg_config_name='linux'" >> ${install_root}/var/aps/packages/linux/package && + echo "pkg_config_makedepends=''" >> ${install_root}/var/aps/packages/linux/package && + echo "pkg_config_depends=''" >> ${install_root}/var/aps/packages/linux/package ;; # Destroys the symlink. - destroy) rm -rfv /usr/src/linux ;; + destroy) rm -rfv ${install_root}/usr/src/linux ;; esac - fi esac diff --git a/aps b/aps index 8766e86..3e4fb51 100755 --- a/aps +++ b/aps @@ -1,10 +1,14 @@ #!/bin/sh -temp_location="/var/tmp" -install_root="/var/tmp/alroot" -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" +if [ -f "/etc/al/config" ]; then + . /etc/al/config +else + temp_location="/var/tmp" + install_root="/var/tmp/alroot" + 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" +fi die() { echo "aps: fatal: ${1}" rm "${lock}" diff --git a/config/config b/config/config new file mode 100755 index 0000000..c4db539 --- /dev/null +++ b/config/config @@ -0,0 +1,11 @@ + +########################## +# A config file for the # +# Alnux Packaging System # +########################## +temp_location="/var/tmp" +install_root="/var/tmp/alroot" +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" diff --git a/install.sh b/install.sh index f3c534f..31ad99d 100755 --- a/install.sh +++ b/install.sh @@ -16,5 +16,6 @@ else 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 + ${prefix}/usr/bin/aps sync alnux && + install -v config/config /etc/al fi From a718517dc7a2b4322fabeaf46274df1e95908a71 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 12:31:44 +0100 Subject: [PATCH 9/9] what --- 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