3
# Copyright (C) 2017 Etersoft
4
# Copyright (C) 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/>.
22
# disable warming up until set warmup in /etc/eepm/eepm.conf
23
[ -n "$warmup" ] || return 1
25
# disable warm if have no enough memory
26
[ "$DISTRMEMORY" -ge 1024 ] && return 0
27
warning "Skipping warmup bases due low memory size"
36
[ -n "$D" ] && info "Warming up $D ..."
37
# TODO: use progress, calc files size before
38
docmd cat $* >/dev/null 2>/dev/null
43
is_warmup_allowed || return 0
44
__warmup_files "rpm" "/var/lib/rpm/*"
49
is_warmup_allowed || return 0
50
__warmup_files "dpkg" "/var/lib/dpkg/*"
69
is_warmup_allowed || return
70
__warmup_files "apt" "/var/lib/apt/lists/* /var/cache/apt/*.bin"
86
DISquiet=1 warmup_lowbase
87
DISquiet=1 warmup_hibase