summaryrefslogtreecommitdiff
path: root/sys-apps/personal-utils/files/emergefix
blob: 2a3a3b0c5a6f9819519821a23684173fec6610fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
set -e

fail_ask() {
	echo -ne "\e[1;31mContinue?\e[0m "
	read
}

get_perl_version() {
	equery list -F '$version' dev-lang/perl
}

#################################################################################

echo -e '\e[1;34m========== Update packages ==========\e[0m'
emerge -auDU --with-bdeps=y --keep-going @world "$@" || fail_ask

echo -e '\e[1;34m========== Rebuil packages ==========\e[0m'
revdep-rebuild -- "$@" || fail_ask

echo -e '\e[1;34m========== Rebuild preserved ones ==========\e[0m'
emerge --keep-going=y @preserved-rebuild || fail_ask

echo -e '\e[1;34m========== Clean packages ==========\e[0m'
emerge --depclean -a "$@"