Last pre-release snapshot (20:35.01.10.2021 eu/pl)

This commit is contained in:
Ohio2 2021-10-01 20:35:40 +02:00
parent 19838ae794
commit bbd1bec527

31
aps
View file

@ -186,6 +186,27 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${
[ ! -d "${locpkg_database}/${1}/${2}" ] && err "Target not found."
install_local_package "${locpkg_database}/${1}/${2}"
}
update() {
prn "Upgrading installed packages"
cd "${installed_pkg_database}" || err "Could not enter local installed package database directory. Exiting..."
for pkg in */; do
installed_pkg_path="${installed_pkg_database}/${pkg}"
. "${installed_pkg_path}/package"
pkg_name="${installed_pkg_path%/}"
pkg_name="${pkg_name##*/}"
already_installed_version=${pkg_config_ver}
[ ! -d "${locpkg_database}/${1}/${pkg_name}" ] && die "Package ${pkg_name} was not found in ${1}. Exiting..."
. "${locpkg_database}/${1}/${pkg_name}/package"
if [ ! "${already_installed_version}" = "${pkg_config_ver}" ]; then
echo ":: Updating package ${pkg_name} (out of date)"
install_package_from_repo "${1}" "${pkg_name}"
fi
unset pkg_config_deploy
unset pkg_config_ver
unset pkg_config_makedepends
unset pkg_config_depends
done
}
function help(){
prn "h|help) prints this message"
prn "v|version) version"
@ -199,13 +220,11 @@ function version(){
function main(){
dbg
case $1 in
s|sync) err "This feature is currently disabled in APS" ;;
#s|sync) sync_local_repo_database "official" ${official}
# [ -z "${2}" ] && exit 0
# install_package_from_repo "official" "${2}" ;;
s|sync) sync_local_repo_database "official" ${official}
[ -z "${2}" ] && exit 0
install_package_from_repo "official" "${2}" ;;
i|install) pkg_local ${*: -1} ;;
#u|update) update ;;
u|update) err "This feature is currently disabled in APS" ;;
u|update) update ;;
v|version) version ;;
h|help) help ;;
*) err "Invalid option"