epm-check 2.03 KB
Newer Older
1 2
#!/bin/sh
#
3 4
# Copyright (C) 2012-2019  Etersoft
# Copyright (C) 2012-2019  Vitaly Lipatov <lav@etersoft.ru>
5
#
6 7 8
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
9 10 11 12 13
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU Affero General Public License for more details.
15
#
16 17
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18 19
#

20 21
load_helper epm-check_updated_repo

22 23
epm_check()
{
24
update_repo_if_needed
25 26
local APTOPTIONS="$(subst_option non_interactive -y)"
local DNFOPTIONS="$(subst_option non_interactive -y) $(subst_option verbose --verbose) "
27
case $PMTYPE in
28 29 30
	apt-rpm)
		#sudocmd apt-get check || exit
		#sudocmd apt-get update || exit
31
		sudocmd apt-get -f $APTOPTIONS install || return
32
		info "You can use epm dedup also"
33 34
		;;
	apt-dpkg)
35
		#sudocmd apt-get check || exit
Vitaly Lipatov's avatar
Vitaly Lipatov committed
36
		#sudocmd apt-get update || exit
37
		sudocmd apt-get -f $APTOPTIONS install || return
38
		;;
39
	packagekit)
40 41
		docmd pkcon repair
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
42
	aptitude-dpkg)
43
		sudocmd aptitude -f $APTOPTIONS install || return
Vitaly Lipatov's avatar
Vitaly Lipatov committed
44 45
		#sudocmd apt-get autoremove
		;;
46
	yum-rpm)
47
		docmd yum check $DNFOPTIONS
48 49
		docmd package-cleanup --problems

Vitaly Lipatov's avatar
Vitaly Lipatov committed
50 51
		#docmd package-cleanup --dupes
		sudocmd package-cleanup --cleandupes
52

53
		docmd rpm -Va --nofiles --nodigest
54
		;;
55
	dnf-rpm)
56
		sudocmd dnf check $DNFOPTIONS
57
		;;
58
	emerge)
59 60
		sudocmd revdep-rebuild
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
61 62 63
	#urpm-rpm)
	#	sudocmd urpme --auto-orphans
	#	;;
64
	zypper-rpm)
65
		sudocmd zypper $(subst_option non_interactive --non-interactive) verify
66 67 68
		;;
	conary)
		sudocmd conary verify
69
		;;
70 71 72
	pkgng)
		sudocmd pkg check -d -a
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
73
	homebrew)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
74
		docmd brew doctor
Vitaly Lipatov's avatar
Vitaly Lipatov committed
75
		;;
76 77 78
	xbps)
		sudocmd xbps-pkgdb -a
		;;
79
	*)
80
		fatal "Have no suitable command for $PMTYPE"
81 82 83 84
		;;
esac

}