NBash

Форк
0
/
epm-whatprovides 
60 строк · 1.6 Кб
1
#!/bin/sh
2
#
3
# Copyright (C) 2013, 2016, 2018  Etersoft
4
# Copyright (C) 2013, 2016, 2018  Vitaly Lipatov <lav@etersoft.ru>
5
#
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.
10
#
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.
15
#
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/>.
18
#
19

20
load_helper epm-print
21

22
epm_whatprovides()
23
{
24
    local CMD
25
    [ -n "$pkg_files" ] && fatal "whatprovides does not handle files"
26
    [ -n "$pkg_names" ] || fatal "whatprovides: package name is missed"
27
    local pkg=$(print_name $pkg_names)
28

29
# by package name
30
case $PMTYPE in
31
    conary)
32
        CMD="conary repquery --what-provides"
33
        ;;
34
    apt-rpm|apt-dpkg|aptitude-dpkg)
35
        LC_ALL=C docmd apt-get install --print-uris $pkg | grep "^Selecting" | cut -f2 -d" "
36
        return
37
        ;;
38
    yum-rpm)
39
        CMD="yum whatprovides"
40
        ;;
41
    urpm-rpm)
42
        CMD="urpmq --whatprovides"
43
        ;;
44
    dnf-rpm)
45
        CMD="yum provides"
46
        ;;
47
    zypper-rpm)
48
        CMD="zypper what-provides"
49
        ;;
50
    opkg)
51
        CMD="opkg whatprovides"
52
        ;;
53
    *)
54
        fatal "Have no suitable command for $PMTYPE"
55
        ;;
56
esac
57

58
docmd $CMD $pkg
59

60
}
61

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.