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

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

22 23
load_helper epm-sh-warmup

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

29 30
warmup_hibase

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

}