epm-update 2.16 KB
Newer Older
1 2
#!/bin/sh
#
3 4
# Copyright (C) 2012, 2014, 2016  Etersoft
# Copyright (C) 2012, 2014, 2016  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 23
#

# copied from korinf/tools/run-script/scripts/update

epm_update()
{
24
	[ -z "$pkg_filenames" ] || fatal "No arguments are allowed here"
Vitaly Lipatov's avatar
Vitaly Lipatov committed
25
	info "Running command for update remote package repository database"
26

27
case $PMTYPE in
28
	apt-rpm)
29
		sudocmd apt-get update || return
30
		#sudocmd apt-get -f install || exit
31
		;;
32
	apt-dpkg)
33
		sudocmd apt-get update || return
34 35
		#sudocmd apt-get -f install || exit
		#sudocmd apt-get autoremove
Vitaly Lipatov's avatar
Vitaly Lipatov committed
36
		;;
37 38 39
	#snappy)
	#	sudocmd snappy
	#	;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
40
	aptitude-dpkg)
41
		sudocmd aptitude update || return
Vitaly Lipatov's avatar
Vitaly Lipatov committed
42
		;;
43
	yum-rpm)
44
		info "update command is stubbed for yum"
45
		# yum makecache
46 47 48 49
		#sudocmd yum check-update
		;;
	dnf-rpm)
		info "update command is stubbed for dnf"
50
		# dnf makecache
51
		#sudocmd dnf check-update
52
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
53
	urpm-rpm)
54
		sudocmd urpmi.update -a
55
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
56
	pacman)
57
		sudocmd pacman -S -y
Vitaly Lipatov's avatar
Vitaly Lipatov committed
58
		;;
59 60 61
	aura)
		sudocmd aura -A -y
		;;
62
	zypper-rpm)
63
		sudocmd zypper refresh
64
		;;
65
	emerge)
66
		sudocmd emerge --sync
67
		;;
68
	slackpkg)
69
		sudocmd /usr/sbin/slackpkg -batch=on update
70
		;;
71 72 73
	deepsolver-rpm)
		sudocmd ds-update
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
74 75 76
	npackd)
		sudocmd packdcl detect # get packages from MSI database
		;;
77
	homebrew)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
78
		docmd brew update
79 80 81 82
		;;
	ipkg)
		sudocmd ipkg update
		;;
83 84 85
	apk)
		sudocmd apk update
		;;
86 87 88 89
	pkgsrc)
		# portsnap extract for the first time?
		sudocmd portsnap fetch update
		;;
90 91 92
	aptcyg)
		sudocmd apt-cyg update
		;;
93 94 95
	xbps)
		sudocmd xbps-install -S
		;;
96
	*)
97
		fatal "Have no suitable update command for $PMTYPE"
98 99 100 101
		;;
esac

}