From bbd1bec5271f61befe849a337381219ecadcaf3d Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Fri, 1 Oct 2021 20:35:40 +0200 Subject: [PATCH] Last pre-release snapshot (20:35.01.10.2021 eu/pl) --- aps | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/aps b/aps index f503b08..31068e8 100755 --- a/aps +++ b/aps @@ -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"