summaryrefslogtreecommitdiff
path: root/sys-apps/personal-utils/files/emergefix
blob: dc7c1f260990bdbc6ec92cb018c1cd9dca82240a (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
#!/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 "$@"

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