aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-07-19 12:20:22 +0000
committermerakor <cem@ckyln.com>2021-07-19 12:20:22 +0000
commite7b53041d08c088f50121a28fa75ac527a49b3ce (patch)
treeacd1b847674df866d803c1bdab984c5e2213da4d /src
parentf607bcfe57dfd57e62dee4c8564c845e47ad52e4 (diff)
downloadcpt-e7b53041d08c088f50121a28fa75ac527a49b3ce.tar.gz
pkg_query_meta: accept full path as well as package names
FossilOrigin-Name: d0203f624858114c808537c5b1ac594d13c32bdd097b463c46a951c1390af75e
Diffstat (limited to 'src')
-rw-r--r--src/cpt-lib.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cpt-lib.in b/src/cpt-lib.in
index 4675d19..407fd82 100644
--- a/src/cpt-lib.in
+++ b/src/cpt-lib.in
@@ -2000,8 +2000,11 @@ pkg_gentree() (
pkg_query_meta() {
# Query the 'meta' file of the given meta package. If there is no meta file,
# or the key being queried is unavailable, the function will return with
- # error.
- repo_dir=$(pkg_find "$1")
+ # error. Full path can be specified instead of package names.
+ case $1 in
+ */*) repo_dir=$1 ;;
+ *) repo_dir=$(pkg_find "$1")
+ esac
[ -f "$repo_dir/meta" ] || return
while IFS=': ' read -r key val; do
case $key in