Add altools/sel, altools/repo, install.sh & add config file support. #8

Merged
hippoz merged 11 commits from Ohio2/aps:master into master 2021-08-25 14:46:01 +03:00
3 changed files with 21 additions and 5 deletions
Showing only changes of commit f473df35b6 - Show all commits

10
altools/repo Normal file → Executable file
View file

@ -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

View file

@ -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

View file

@ -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