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