aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinhard Leichtfuß <alguien@respiranto.de>2018-11-29 21:01:30 +0100
committerEinhard Leichtfuß <alguien@respiranto.de>2018-11-29 21:01:30 +0100
commit0c3e80bf655d57e23d3a27ce2ca193bc02f76eaa (patch)
tree2093f94b276755f04064716c12a2f0584cf9512b
parent9ff096d2523060e1cc594389e0098dc77ed830a6 (diff)
downloadauria-0c3e80bf655d57e23d3a27ce2ca193bc02f76eaa.tar.gz
auria-0c3e80bf655d57e23d3a27ce2ca193bc02f76eaa.tar.xz
Properly differentiate between local and repository pkgs
-rw-r--r--TODO3
-rwxr-xr-xauria.sh18
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"); } \