epm-update 2.28 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
	packagekit)
42 43
		docmd pkcon refresh
		;;
44 45 46
	#snappy)
	#	sudocmd snappy
	#	;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
47
	aptitude-dpkg)
48
		sudocmd aptitude update || return
Vitaly Lipatov's avatar
Vitaly Lipatov committed
49
		;;
50
	yum-rpm)
51 52
		# just skipped
		[ -n "$verbose" ] && info "update command is stubbed for yum"
53 54
		;;
	dnf-rpm)
55 56
		# just skipped
		[ -n "$verbose" ] && info "update command is stubbed for dnf"
57
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
58
	urpm-rpm)
59
		sudocmd urpmi.update -a
60
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
61
	pacman)
62
		sudocmd pacman -S -y
Vitaly Lipatov's avatar
Vitaly Lipatov committed
63
		;;
64 65 66
	aura)
		sudocmd aura -A -y
		;;
67
	zypper-rpm)
68
		sudocmd zypper refresh
69
		;;
70
	emerge)
71
		sudocmd emerge --sync
72
		;;
73
	slackpkg)
74
		sudocmd /usr/sbin/slackpkg -batch=on update
75
		;;
76 77 78
	deepsolver-rpm)
		sudocmd ds-update
		;;
Vitaly Lipatov's avatar
Vitaly Lipatov committed
79 80 81
	npackd)
		sudocmd packdcl detect # get packages from MSI database
		;;
82
	homebrew)
Vitaly Lipatov's avatar
Vitaly Lipatov committed
83
		docmd brew update
84
		;;
85 86
	opkg)
		sudocmd opkg update
87
		;;
88 89 90
	apk)
		sudocmd apk update
		;;
91 92 93 94
	pkgsrc)
		# portsnap extract for the first time?
		sudocmd portsnap fetch update
		;;
95 96 97
	aptcyg)
		sudocmd apt-cyg update
		;;
98 99 100
	xbps)
		sudocmd xbps-install -S
		;;
101 102 103
	winget)
		sudocmd winget source update
		;;
104
	*)
105
		fatal "Have no suitable update command for $PMTYPE"
106 107 108 109
		;;
esac

}