Commit f9cfb159 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-query_file: fix on deb systems

parent 334ee0ee
...@@ -48,13 +48,13 @@ __do_query_real_file() ...@@ -48,13 +48,13 @@ __do_query_real_file()
fi fi
if [ -n "$short" ] ; then if [ -n "$short" ] ; then
__do_short_query "$TOFILE" __do_short_query "$TOFILE" || return
else else
__do_query "$TOFILE" __do_query "$TOFILE" || return
fi fi
# get value of symbolic link # get value of symbolic link
if [ -L "$TOFILE" ] ; then if [ -n "$TOFILE" ] && [ -L "$TOFILE" ] ; then
local LINKTO local LINKTO
LINKTO=$(readlink -- "$TOFILE") LINKTO=$(readlink -- "$TOFILE")
info " > $TOFILE is link to $LINKTO" info " > $TOFILE is link to $LINKTO"
...@@ -67,7 +67,8 @@ dpkg_print_name_version() ...@@ -67,7 +67,8 @@ dpkg_print_name_version()
{ {
local ver i local ver i
for i in "$@" ; do for i in "$@" ; do
ver=$(dpkg -s $i 2>/dev/null | grep "Version:" | sed -e "s|Version: ||g") [ -n "$i" ] || continue
ver=$(dpkg -s "$i" 2>/dev/null | grep "Version:" | sed -e "s|Version: ||g")
if [ -z "$ver" ] ; then if [ -z "$ver" ] ; then
echo "$i" echo "$i"
else else
...@@ -83,7 +84,7 @@ __do_query() ...@@ -83,7 +84,7 @@ __do_query()
case $PMTYPE in case $PMTYPE in
*-dpkg) *-dpkg)
showcmd dpkg -S "$1" showcmd dpkg -S "$1"
dpkg_print_name_version "$(dpkg -S $1 | grep -v "^diversion by" | sed -e "s|:.*||")" dpkg_print_name_version "$(dpkg -S "$1" | grep -v "^diversion by" | sed -e "s|:.*||")"
return ;; return ;;
*-rpm) *-rpm)
CMD="rpm -qf" CMD="rpm -qf"
......
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