From f473df35b66ee5dd4581f68deb4c11729add6942 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 25 Aug 2021 11:37:56 +0200 Subject: [PATCH] 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