3
# Copyright (C) 2013 Etersoft
4
# Copyright (C) 2013 Vitaly Lipatov <lav@etersoft.ru>
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU Affero General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
16
# You should have received a copy of the GNU Affero General Public License
17
# along with this program. If not, see <http://www.gnu.org/licenses/>.
26
[ -n "$pkg_files" ] || return
28
local PKGTYPE="$(get_package_type $pkg_files)"
33
if [ -n "$short" ] ; then
34
docmd rpm -q --provides -p $pkg_files | sed -e 's| .*||'
36
docmd rpm -q --provides -p $pkg_files
41
# FIXME: will we provide ourself?
42
docmd dpkg -I $pkg_files | grep "^ *Provides:" | sed "s|^ *Provides:||g"
45
fatal "Have no suitable command for $PMTYPE"
55
[ -n "$pkg_names" ] || return
60
# FIXME: need fix for a few names case
61
# TODO: separate this function to two section
62
if is_installed $pkg_names ; then
63
CMD="rpm -q --provides"
65
EXTRA_SHOWDOCMD=' | grep "Provides:"'
66
if [ -n "$short" ] ; then
67
docmd apt-cache show $pkg_names | grep "Provides:" | sed -e 's|, |\n|g' -e 's|Provides: ||' -e 's| .*||'
69
docmd apt-cache show $pkg_names | grep "Provides:" | sed -e 's|, |\n|g' -e 's|Provides: ||'
75
if is_installed $pkg_names ; then
76
CMD="rpm -q --provides"
78
CMD="urpmq --provides"
82
if is_installed $pkg_names ; then
83
CMD="rpm -q --provides"
85
fatal "FIXME: use hi level commands or download firstly"
89
if is_installed $pkg_names ; then
90
CMD="rpm -q --provides"
92
fatal "FIXME: use hi level commands or download firstly"
96
if is_installed $pkg_names ; then
97
CMD="rpm -q --provides"
99
CMD="dnf repoquery --provides"
113
# FIXME: need fix for a few names case
114
if is_installed $pkg_names ; then
115
showcmd dpkg -s $pkg_names
116
a='' dpkg -s $pkg_names | grep "^Provides:" | sed "s|^Provides:||g"
119
EXTRA_SHOWDOCMD=' | grep "Provides:"'
120
docmd apt-cache show $pkg_names | grep "Provides:" | sed -e 's|, |\n|g' | grep -v "^Provides:"
125
fatal "Have no suitable command for $PMTYPE"
129
if [ -n "$direct" ] && [ "$CMD" = "rpm -q --provides" ] ; then
130
# do universal provides
131
docmd $CMD $pkg_names | sed -e 's| .*||' | grep -F "()"
132
a= $CMD $pkg_names | sed -e 's| .*||' | grep -v -E "^(lib|ld-linux)"
133
elif [ -n "$short" ] ; then
134
docmd $CMD $pkg_names | sed -e 's| .*||'
136
docmd $CMD $pkg_names
143
# if possible, it will put pkg_urls into pkg_files or pkg_names
144
if [ -n "$pkg_urls" ] ; then
145
load_helper epm-download
146
__handle_pkg_urls_to_checking
149
[ -n "$pkg_filenames" ] || fatal "Provides: package name is missed"
151
epm_provides_files $pkg_files
152
# shellcheck disable=SC2046
153
epm_provides_names $(print_name $pkg_names)