3
# Copyright (C) 2012,2014,2016,2017 Etersoft
4
# Copyright (C) 2012,2014,2016,2017 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
load_helper epm-install
21
load_helper epm-sh-warmup
23
# copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg
30
local APTOPTIONS="$(subst_option non_interactive -y)"
31
sudocmd apt-get --reinstall $APTOPTIONS install $@
34
sudocmd aptitude reinstall $@
37
warning "Please send me the correct command form for it"
38
docmd pkcon install --allow-reinstall $@
41
sudocmd yum reinstall $@
44
sudocmd dnf reinstall $@
47
sudocmd brew reinstall $@
50
sudocmd pkg install -f $@
53
sudocmd pkg reinstall $@
56
sudocmd opkg --force-reinstall install $@
59
sudocmd eopkg --reinstall install $@
62
sudocmd_foreach "/usr/sbin/slackpkg reinstall" $@
66
# fallback to generic install
76
sudocmd rpm -Uvh --force $@ && return
77
sudocmd apt-get --reinstall install $@
79
apt-dpkg|aptitude-dpkg)
83
sudocmd_foreach "/sbin/installpkg" $@
87
# other systems can install file package via ordinary command
88
epm_reinstall_names $@
94
[ -n "$pkg_filenames" ] || fatal "Reinstall: package name is missed."
98
# get package name for hi level package management command (with version if supported and if possible)
99
pkg_names=$(__epm_get_hilevel_name $pkg_names)
103
epm_reinstall_names $pkg_names
104
epm_reinstall_files $pkg_files