Commit 9cb26905 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-query: add support for query file package

parent 59dc3319
...@@ -34,11 +34,38 @@ _query_via_packages_list() ...@@ -34,11 +34,38 @@ _query_via_packages_list()
return $res return $res
} }
epm_query() __epm_query_file()
{ {
[ -n "$pkg_filenames" ] || fatal "Run query without names" local CMD
[ -z "$@" ] && return
case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm)
CMD="rpm -qp"
;;
apt-dpkg)
CMD="dpkg-deb --show"
# TODO: make rpm-like output
#showcmd dpkg -l $pkg_filenames
#dpkg -l $pkg_filenames | grep "^ii"
#return
;;
*)
fatal "Do not know command for query file package"
;;
esac
docmd $CMD $pkg_files
}
case $PMTYPE in __epm_query_name()
{
local CMD
[ -z "$@" ] && return
case $PMTYPE in
apt-rpm|yum-rpm|urpm-rpm|zypper-rpm) apt-rpm|yum-rpm|urpm-rpm|zypper-rpm)
CMD="rpm -q" CMD="rpm -q"
;; ;;
...@@ -50,14 +77,23 @@ case $PMTYPE in ...@@ -50,14 +77,23 @@ case $PMTYPE in
#return #return
;; ;;
npackd) npackd)
CMD="npackdcl path --package=$pkg_filenames" CMD="npackdcl path --package=$pkg_names"
;; ;;
*) *)
_query_via_packages_list $pkg_filenames _query_via_packages_list $pkg_names
return return
;; ;;
esac esac
docmd $CMD $pkg_names
}
epm_query()
{
[ -n "$pkg_filenames" ] || fatal "Run query without names"
docmd $CMD $pkg_filenames __epm_query_file $pkg_files || return
__epm_query_name $pkg_names || return
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment