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
# by package name
case $PMTYPE in
apt-rpm)
# FIXME: need fix for a few names case
# TODO: separate this function to two section
if is_installed $pkg_names ; then
CMD="rpm -q --provides"
else
CMD="apt-cache depends"
EXTRA_SHOWDOCMD=' | grep "Provides:"'
docmd apt-cache show $pkg_names | grep "Provides:"
return
fi
;;
urpm-rpm|zypper-rpm|yum-rpm)
......@@ -64,9 +68,16 @@ case $PMTYPE in
# yum-rpm)
# CMD="yum deplist"
# ;;
# apt-dpkg)
# CMD="apt-cache depends"
# ;;
apt-dpkg)
# 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"
;;
......
#!/bin/sh
#
# Copyright (C) 2012 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012-2013 Etersoft
# Copyright (C) 2012-2013 Vitaly Lipatov <lav@etersoft.ru>
#
# 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
......@@ -17,6 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-query
epm_requires()
{
local CMD
......@@ -31,11 +34,14 @@ case $PMTYPE in
CMD="rpm -q --requires -p"
;;
apt-dpkg)
if [ -n "$pkg_files" ] ; then
# FIXME: need package base
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
# TODO: separate to two section
return
fi
;;
*)
fatal "Have no suitable command for $PMTYPE"
......@@ -46,7 +52,20 @@ esac
# by package name
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
CMD="rpm -q --requires"
;;
......@@ -57,7 +76,14 @@ case $PMTYPE in
CMD="pactree"
;;
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"
fi
;;
emerge)
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