epm-clean 1.05 KB
Newer Older
1 2 3 4 5
#!/bin/sh
#
# Copyright (C) 2012  Etersoft
# Copyright (C) 2012  Vitaly Lipatov <lav@etersoft.ru>
#
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
#

epm_clean()
{
Vitaly Lipatov's avatar
Vitaly Lipatov committed
22 23
case $PMTYPE in
	apt-rpm|apt-dpkg)
24
		sudocmd apt-get clean
25
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
26
	yum-rpm)
27 28
		sudocmd yum clean all
		sudocmd yum makecache
29
		;;
30 31 32
	dnf-rpm)
		sudocmd dnf clean all
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
33
	urpm-rpm)
34
		sudocmd urpmi --clean
35
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
36
	zypper-rpm)
37
		sudocmd zypper clean
38 39
		;;
	*)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
40
		fatal "Do not known command for $PMTYPE"
41 42 43 44
		;;
esac

}