Commit 7a8958c2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-query: add -- after options, fix query --short for rpm

parent d297792a
......@@ -136,8 +136,8 @@ __epm_get_hilevel_nameform()
apt-rpm)
# use # as delimeter for apt
local pkg
pkg=$(rpm -q --queryformat "%{NAME}#%{SERIAL}:%{VERSION}-%{RELEASE}\n" $1)
echo $pkg | grep -q "(none)" && pkg=$(rpm -q --queryformat "%{NAME}#%{VERSION}-%{RELEASE}\n" $1)
pkg=$(rpm -q --queryformat "%{NAME}#%{SERIAL}:%{VERSION}-%{RELEASE}\n" -- $1)
echo $pkg | grep -q "(none)" && pkg=$(rpm -q --queryformat "%{NAME}#%{VERSION}-%{RELEASE}\n" -- $1)
# HACK: can use only for multiple install packages like kernel
echo $pkg | grep -q kernel || return 1
echo $pkg
......@@ -146,8 +146,8 @@ __epm_get_hilevel_nameform()
yum-rpm|dnf-rpm)
# just use strict version with Epoch and Serial
local pkg
pkg=$(rpm -q --queryformat "%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" $1)
echo $pkg | grep -q "(none)" && pkg=$(rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" $1)
pkg=$(rpm -q --queryformat "%{EPOCH}:%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" -- $1)
echo $pkg | grep -q "(none)" && pkg=$(rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n" -- $1)
echo $pkg
return
;;
......@@ -194,7 +194,7 @@ __epm_query_file()
;;
esac
docmd $CMD $@
docmd $CMD -- $@
}
# hack: dpkg -W will print names for removed packages too (until newest Ubuntu)
......@@ -220,7 +220,7 @@ __epm_query_name()
*-dpkg)
#docmd dpkg -l $@ | grep "^ii"
#CMD="dpkg-query -W --showformat=\${Package}-\${Version}\n"
docmd dpkg-query -W "--showformat=\${Package}-\${Version}\n" $@ || return
docmd dpkg-query -W "--showformat=\${Package}-\${Version}\n" -- $@ || return
__epm_query_dpkg_check $@ || return
return
;;
......@@ -266,11 +266,13 @@ __epm_query_shortname()
case $PMTYPE in
*-rpm)
CMD="rpm -q --queryformat %{name}\n"
showcmd rpm -q --queryformat '%{name} \n' -- $@
a='' rpm -q --queryformat '%{name} \n' -- $@
return
;;
*-dpkg)
#CMD="dpkg-query -W --showformat=\${Package}\n"
docmd dpkg-query -W "--showformat=\${Package}\n" $@ || return
docmd dpkg-query -W "--showformat=\${Package}\n" -- $@ || return
__epm_query_dpkg_check $@ || return
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