Commit 21c1f78f authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-query: print out in name-version format, fix epm-packages for dpkg to print name-version only

parent fe1ee305
...@@ -27,7 +27,8 @@ case $PMTYPE in ...@@ -27,7 +27,8 @@ case $PMTYPE in
[ -n "$short" ] && CMD="rpm -qa --queryformat %{name}\n $pkg_filenames" [ -n "$short" ] && CMD="rpm -qa --queryformat %{name}\n $pkg_filenames"
;; ;;
apt-dpkg) apt-dpkg)
CMD="dpkg -l $pkg_filenames" #CMD="dpkg -l $pkg_filenames"
CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n $pkg_filenames"
[ -n "$short" ] && CMD="dpkg-query -W --showformat=\${Package}\n $pkg_filenames" [ -n "$short" ] && CMD="dpkg-query -W --showformat=\${Package}\n $pkg_filenames"
;; ;;
yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm) yum-rpm|urpm-rpm|zypper-rpm|dnf-rpm)
......
...@@ -26,11 +26,14 @@ _query_via_packages_list() ...@@ -26,11 +26,14 @@ _query_via_packages_list()
local res=0 local res=0
local firstpkg=$1 local firstpkg=$1
shift shift
# separate first line for print out command # separate first line for print out command
short=1 pkg_filenames=$firstpkg epm_packages | grep -- "^$firstpkg$" || res=1 pkg_filenames=$firstpkg epm_packages | grep -- "^$firstpkg$" || res=1
for pkg in "$@" ; do for pkg in "$@" ; do
short=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -- "^$pkg$" || res=1 pkg_filenames=$pkg epm_packages 2>/dev/null | grep -- "^$pkg$" || res=1
done done
return $res return $res
} }
...@@ -43,13 +46,11 @@ __epm_query_file() ...@@ -43,13 +46,11 @@ __epm_query_file()
case $PMTYPE in case $PMTYPE in
*-rpm) *-rpm)
CMD="rpm -qp" CMD="rpm -qp"
[ -n "$short" ] && CMD="rpm -qp --queryformat %{name}\n"
;; ;;
apt-dpkg) apt-dpkg)
CMD="dpkg-deb --show" CMD="dpkg-deb --show --showformat=\${Package}-\${Version}\n"
# TODO: make rpm-like output [ -n "$short" ] && CMD="dpkg-query --show --showformat=\${Package}\n"
#showcmd dpkg -l $pkg_filenames
#dpkg -l $pkg_filenames | grep "^ii"
#return
;; ;;
*) *)
fatal "Do not know command for query file package" fatal "Do not know command for query file package"
...@@ -68,14 +69,12 @@ __epm_query_name() ...@@ -68,14 +69,12 @@ __epm_query_name()
case $PMTYPE in case $PMTYPE in
*-rpm) *-rpm)
CMD="rpm -q" CMD="rpm -q"
[ -n "$short" ] && CMD="rpm -q --queryformat %{name}\n"
;; ;;
apt-dpkg) apt-dpkg)
#docmd dpkg -l $@ #docmd dpkg -l $@ | grep "^ii"
docmd dpkg -l $@ | grep "^ii" CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n"
# TODO: make rpm-like output [ -n "$short" ] && CMD="dpkg-query -W --showformat=\${Package}\n"
#showcmd dpkg -l $pkg_filenames
#dpkg -l $pkg_filenames | grep "^ii"
return
;; ;;
npackd) npackd)
CMD="npackdcl path --package=$@" CMD="npackdcl path --package=$@"
......
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