epm-check 1.87 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 22
#

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

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

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

}