summaryrefslogtreecommitdiff
path: root/sys-apps/personal-utils/files/emergefix
blob: bcec51d3fadedaa481b1f3f7671e53344b66dc72 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
set -e

step() {
	echo -e '\e[1;34m==========' "$@" '==========\e[0m'
}

run() {
	"$@" || {
		echo -ne "\e[1;31mContinue?\e[0m "
		read
	}
}

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

step "Update packages"
run emerge -auDU --with-bdeps=y --keep-going @world "$@"

step "Rebuil packages"
run revdep-rebuild -- "$@"

step "Rebuild preserved ones"
run emerge --keep-going=y @preserved-rebuild

step "Clean packages"
run emerge --depclean -a "$@"

if eselect modules has fontconfig; then
	step "Enable all fonts"
	enable_all_fonts() {
		eselect fontconfig list | \
			awk 'NR > 1 && $3 != "*" { print substr($1,2,length($1)-2) }' | \
			while read -r font; do
				eselect fontconfig enable "$font"
			done
	}
	enable_all_fonts
fi