3
# Copyright (C) 2012-2020 Etersoft
4
# Copyright (C) 2012-2020 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
epm_install_files_apt_dpkg()
23
[ -z "$files" ] && return
25
# the new version of the conf. file is installed with a .dpkg-dist suffix
26
if [ -n "$non_interactive" ] ; then
27
DPKGOPTIONS="--force-confdef --force-confold"
30
if __epm_repack_if_needed $files ; then
31
[ -n "$repacked_pkgs" ] || fatal "Can't convert $files"
32
files="$repacked_pkgs"
35
if [ -n "$save_only" ] ; then
37
cp -v $files "$EPMCURDIR"
41
if [ -n "$put_to_repo" ] ; then
42
load_helper epm-repopkg
43
epm_put_to_repo $files
48
# TODO: if dpkg can't install due missed deps, trying with apt (as for now, --refuse-depends, --refuse-breaks don't help me)
50
if [ -n "$nodeps" ] ; then
51
sudocmd dpkg $DPKGOPTIONS -i $files
56
# TODO: check apt-get version?
57
apt_can_install_files='1'
58
if [ "$DISTRNAME" = "Ubuntu" ] ; then
59
[ "$DISTRVERSION" = "14.04" ] && apt_can_install_files=''
60
[ "$DISTRVERSION" = "12.04" ] && apt_can_install_files=''
63
if [ -n "$apt_can_install_files" ] ; then
64
# TODO: don't resolve fuzzy dependencies ()
65
# are there apt that don't support dpkg files to install?
66
epm_install_names $(make_filepath $files)
72
sudocmd dpkg $DPKGOPTIONS -i $files
75
# return OK if all is OK
76
[ "$RES" = "0" ] && return $RES
78
# TODO: workaround with epm-check needed only for very old apt
80
# run apt -f install if there are were some errors during install
84
# repeat install for get correct status
85
sudocmd dpkg $DPKGOPTIONS -i $files