2021-08-24 08:32:32 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
########################################
|
|
|
|
# Repo, a repository manager for alnux #
|
|
|
|
########################################
|
2021-08-25 14:01:36 +03:00
|
|
|
. /etc/al/config
|
|
|
|
case $1 in
|
|
|
|
# add a repo
|
2021-09-30 17:26:01 +03:00
|
|
|
add) git clone ${2} ${install_root}/var/db/repos
|
2021-08-25 14:01:36 +03:00
|
|
|
echo "${2}" >> ${install_root}/etc/al/repo.conf
|
2021-08-25 12:43:35 +03:00
|
|
|
;;
|
2021-08-25 14:01:36 +03:00
|
|
|
# update a repo
|
|
|
|
update) pushd && cd ${install_root}/var/aps/repos/${2} && git pull && popd ;;
|
|
|
|
# destroy a repo (remove)
|
2021-09-30 17:26:01 +03:00
|
|
|
destroy) rm -rfv ${install_root}/var/db/aps/repos/${2}
|
2021-08-25 14:01:36 +03:00
|
|
|
sed -i "/^${2}/d" ${install_root}/etc/al/repo.conf
|
|
|
|
;;
|
|
|
|
esac
|