3
# Copyright (C) 2013, 2016, 2018 Etersoft
4
# Copyright (C) 2013, 2016, 2018 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/>.
20
# TODO: will it has local only mode?
27
[ -n "$pkg_files" ] && fatal "whatdepends does not handle files"
28
[ -n "$pkg_names" ] || fatal "whatdepends: package name is missed"
29
local pkg=$(print_name $pkg_names)
34
if [ -z "$verbose" ] ; then
35
showcmd apt-cache whatdepends $pkg
36
if [ -n "$short" ] ; then
37
# TODO: use common converter from full name to short name
38
# TODO: see print_pkgname
39
a= apt-cache whatdepends $pkg | grep "^ [^ ]" | sed -e "s|[0-9]*:||" | grep -E -v "(i586-|-debuginfo)" | sed -e 's|[@:].*||' -e "s|-[0-9].*||g" -e 's|^ *||' -e 's/\.32bit//g'
42
a= apt-cache whatdepends $pkg | grep "^ [^ ]" | sed -e "s|[0-9]*:||" | grep -E -v "(i586-|-debuginfo)"
46
CMD="apt-cache whatdepends"
48
apt-dpkg|aptitude-dpkg)
49
CMD="apt-cache rdepends"
55
CMD="pkcon depends-on"
58
CMD="repoquery --whatrequires"
61
CMD="urpmq --whatrequires"
64
# check command: dnf repoquery --whatrequires
65
CMD="repoquery --whatrequires"
69
CMD="equery depends -a"
78
CMD="apt-cyg rdepends"
81
CMD="opkg whatdepends"
84
showcmd eopkg info $pkg
85
# eopkg info prints it only from repo info
86
LC_ALL=C eopkg info $pkg | grep "^Reverse Dependencies" | sed -e "s|Reverse Dependencies[[:space:]]*: ||" | grep -v "^$"
93
fatal "Have no suitable command for $PMTYPE"