Commit a9a6c520 authored by Vitaly Lipatov's avatar Vitaly Lipatov

fix provides/requires commands for apt-rpm and apm-dpkg

parent 5958b314
...@@ -44,10 +44,14 @@ esac ...@@ -44,10 +44,14 @@ esac
# by package name # by package name
case $PMTYPE in case $PMTYPE in
apt-rpm) apt-rpm)
# FIXME: need fix for a few names case
# TODO: separate this function to two section
if is_installed $pkg_names ; then if is_installed $pkg_names ; then
CMD="rpm -q --provides" CMD="rpm -q --provides"
else else
CMD="apt-cache depends" EXTRA_SHOWDOCMD=' | grep "Provides:"'
docmd apt-cache show $pkg_names | grep "Provides:"
return
fi fi
;; ;;
urpm-rpm|zypper-rpm|yum-rpm) urpm-rpm|zypper-rpm|yum-rpm)
...@@ -64,9 +68,16 @@ case $PMTYPE in ...@@ -64,9 +68,16 @@ case $PMTYPE in
# yum-rpm) # yum-rpm)
# CMD="yum deplist" # CMD="yum deplist"
# ;; # ;;
# apt-dpkg) apt-dpkg)
# CMD="apt-cache depends" # FIXME: need fix for a few names case
# ;; if is_installed $pkg_names ; then
CMD="rpm -q --provides"
else
EXTRA_SHOWDOCMD=' | grep "Provides:"'
docmd apt-cache show $pkg_names | grep "Provides:"
return
fi
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012 Etersoft # Copyright (C) 2012-2013 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2013 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
load_helper epm-query
epm_requires() epm_requires()
{ {
local CMD local CMD
...@@ -31,11 +34,14 @@ case $PMTYPE in ...@@ -31,11 +34,14 @@ case $PMTYPE in
CMD="rpm -q --requires -p" CMD="rpm -q --requires -p"
;; ;;
apt-dpkg) apt-dpkg)
if [ -n "$pkg_files" ] ; then
# FIXME: need package base # FIXME: need package base
showcmd dpkg -s $pkg_files showcmd dpkg -s $pkg_files
a= dpkg -s $pkg_names | grep "^Depends:" | sed "s|^Depends:||g" a= dpkg -s $pkg_files | grep "^Depends:" | sed "s|^Depends:||g"
# FIXME: we need execute package name section too # FIXME: we need execute package name section too
# TODO: separate to two section
return return
fi
;; ;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
...@@ -46,7 +52,20 @@ esac ...@@ -46,7 +52,20 @@ esac
# by package name # by package name
case $PMTYPE in case $PMTYPE in
apt-rpm|urpm-rpm|zypper-rpm) apt-rpm)
# FIXME: need fix for a few names case
# FIXME: too low level of requires name (libSOME.so)
if is_installed $pkg_names ; then
CMD="rpm -q --requires"
else
#EXTRA_SHOWDOCMD=' | grep "Depends:"'
#docmd apt-cache show $pkg_names | grep "Depends:"
#return
CMD="apt-cache depends"
fi
;;
urpm-rpm|zypper-rpm)
# FIXME: use hi level commands # FIXME: use hi level commands
CMD="rpm -q --requires" CMD="rpm -q --requires"
;; ;;
...@@ -57,7 +76,14 @@ case $PMTYPE in ...@@ -57,7 +76,14 @@ case $PMTYPE in
CMD="pactree" CMD="pactree"
;; ;;
apt-dpkg) apt-dpkg)
# FIXME: need fix for a few names case
if is_installed $pkg_names ; then
showcmd dpkg -s $pkg_names
a= dpkg -s $pkg_names | grep "^Depends:" | sed "s|^Depends:||g"
return
else
CMD="apt-cache depends" CMD="apt-cache depends"
fi
;; ;;
emerge) emerge)
assure_exists equery assure_exists equery
......
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