NBash

Форк
0
/
epm-install-print-command 
140 строк · 4.1 Кб
1
#!/bin/sh
2
#
3
# Copyright (C) 2012-2020  Etersoft
4
# Copyright (C) 2012-2020  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

21
epm_print_install_files_command()
22
{
23
    # print out low level command by default (wait --low-level for control it)
24
    #[ -z "$1" ] && return
25
    [ -z "$1" ] && [ -n "$pkg_names" ] && return
26
    case $PMTYPE in
27
        *-rpm)
28
            echo "rpm -Uvh --force $nodeps $*"
29
            ;;
30
        *-dpkg)
31
            echo "dpkg -i $*"
32
            ;;
33
        pkgsrc)
34
            echo "pkg_add $*"
35
            ;;
36
        pkgng)
37
            echo "pkg add $*"
38
            ;;
39
        emerge)
40
            # need be placed in /usr/portage/packages/somewhere
41
            echo "emerge --usepkg $*"
42
            ;;
43
        pacman)
44
            echo "pacman -U --noconfirm $nodeps $*"
45
            ;;
46
        slackpkg)
47
            echo "/sbin/installpkg $*"
48
            ;;
49
        npackd)
50
            echo "npackdcl add --package=$*"
51
            ;;
52
        opkg)
53
            echo "opkg install $*"
54
            ;;
55
        eopkg)
56
            echo "eopkg install $*"
57
            ;;
58
        android)
59
            echo "pm install $*"
60
            ;;
61
        termux-pkg)
62
            echo "pkg install $*"
63
            ;;
64
        aptcyg)
65
            echo "apt-cyg install $*"
66
            ;;
67
        tce)
68
            echo "tce-load -wi $*"
69
            ;;
70
        xbps)
71
            echo "xbps-install -y $*"
72
            ;;
73
        appget|winget)
74
            echo "$PMTYPE install -s $*"
75
            ;;
76
        homebrew)
77
            # FIXME: sudo and quote
78
            echo "brew install $*"
79
            ;;
80

81
        *)
82
            fatal "Have no suitable appropriate install command for $PMTYPE"
83
            ;;
84
    esac
85
}
86

87
epm_print_install_names_command()
88
{
89
    # check for pkg_files to support print out command without pkg names in args
90
    #[ -z "$1" ] && [ -n "$pkg_files" ] && return
91
    [ -z "$1" ] && return
92
    case $PMTYPE in
93
        apt-rpm)
94
            echo "apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true $APTOPTIONS install $*"
95
            return ;;
96
        apt-dpkg)
97
            # this command  not for complex use. ACCEPT_EULA=y DEBIAN_FRONTEND=noninteractive
98
            echo "apt-get -y --force-yes -o APT::Install::VirtualVersion=true -o APT::Install::Virtual=true $APTOPTIONS install $*"
99
            return ;;
100
        aptitude-dpkg)
101
            echo "aptitude -y install $*"
102
            return ;;
103
        yum-rpm)
104
            echo "yum -y $YUMOPTIONS install $*"
105
            return ;;
106
        dnf-rpm)
107
            echo "dnf -y $YUMOPTIONS --allowerasing install $*"
108
            return ;;
109
        urpm-rpm)
110
            echo "urpmi --auto $URPMOPTIONS $*"
111
            return ;;
112
        zypper-rpm)
113
            echo "zypper --non-interactive $ZYPPEROPTIONS install $*"
114
            return ;;
115
        packagekit)
116
            echo "pkcon --noninteractive $*"
117
            return ;;
118
        pacman)
119
            echo "pacman -S --noconfirm $*"
120
            return ;;
121
        choco)
122
            echo "choco install $*"
123
            return ;;
124
        nix)
125
            echo "nix-env --install $*"
126
            return ;;
127
        eopkg)
128
            echo "eopkg install $*"
129
            return ;;
130
        termux-pkg)
131
            echo "pkg install $*"
132
            return ;;
133
        appget|winget)
134
            echo "$PMTYPE install $*"
135
            return ;;
136
        *)
137
            fatal "Have no suitable appropriate install command for $PMTYPE"
138
            ;;
139
    esac
140
}
141

142

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

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

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

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