From 0c3e80bf655d57e23d3a27ce2ca193bc02f76eaa Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Thu, 29 Nov 2018 21:01:30 +0100 Subject: Properly differentiate between local and repository pkgs --- TODO | 3 +++ auria.sh | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 31253f8..3ca8d22 100644 --- a/TODO +++ b/TODO @@ -9,3 +9,6 @@ `- see https://github.com/polygamma/aurman/wiki/Description-of-the-aurman-dependency-solving - Differentiate between normal and make dependencies. - Allow several arguments (packages) to install. +- Consider using https://aur.archlinux.org/packages.gz +- Do something better than failing upon finding a local package not in the + repos nor the AUR. diff --git a/auria.sh b/auria.sh index d7bbfc3..c8da53b 100755 --- a/auria.sh +++ b/auria.sh @@ -528,10 +528,11 @@ function resolve_deps # This does also populate the $repo_deps array. if [[ "$itype" == dep ]] then - depsearch_noaur "$pkg" "$pkgstr" && return 0 + depsearch_local "$pkgstr" && return 0 + depsearch_repos "$pkg" "$pkgstr" && return 0 elif [[ "$itype" == update ]] then - if depsearch_noaur "$pkg" "$pkgstr" + if depsearch_repos "$pkg" "$pkgstr" then inform "$pkgstr exists in the regular repositories." ask n "Try to update from AUR anyways" || return 0 @@ -670,9 +671,17 @@ function install_deptree done } +# $1 package: name [. pkgver-comparator . version string] +# returns result: (0|1) +function depsearch_local +{ + qpacman -T "$1" +} + # $1 package: name # $2 package: name [. pkgver-comparator . version string] -function depsearch_noaur +# returns result: (0|1) +function depsearch_repos { local pkg pkgstr pkg="$1" @@ -681,9 +690,6 @@ function depsearch_noaur # In case of no dep restriction, look up in list first. [[ "$pkg" == "$pkgstr" ]] && match "$pkg" "${repo_deps[@]}" && return 0 - # Search locally. - qpacman -T "$pkgstr" && return 0 - # Search in the repos. qpacman -Sp "$pkgstr" \ && { match "$pkg" "${repo_deps[@]}" || repo_deps+=("$pkg"); } \ -- cgit v1.2.3