aboutsummaryrefslogtreecommitdiff
blob: a8e54bd12a1a37dc5995c5a4543d56fa8ef680db (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
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

cp "$SCRIPT_DIR/make.conf" /etc/portage/make.conf
if [[ -d /etc/portage/package.accept_keywords/ ]]; then
	rm -r /etc/portage/package.accept_keywords/
fi
if [[ -d /etc/portage/package.use/ ]]; then
	rm -r /etc/portage/package.use/
fi

emerge --sync
emerge --metadata
emerge --oneshot portage

RUBIES=(dev-lang/ruby:2.0 dev-lang/ruby:2.1 dev-lang/ruby:2.2 dev-lang/ruby:2.3)
set +e
emerge --pretend --quiet "${RUBIES[@]}"
if [[ $? == 1 ]]; then
	emerge --autounmask-write "${RUBIES[@]}"
	etc-update --automode -5
fi
set -e
emerge --noreplace --quiet "${RUBIES[@]}"