feat: add configuration option to enable/disable portage testing branch via ACCEPT_KEYWORDS="~$GENTOO_ARCH"

This commit is contained in:
oddlama 2022-04-16 15:26:31 +02:00
parent 02db85b545
commit 1ecdf996a0
No known key found for this signature in database
GPG Key ID: 14EFE510775FE39A
3 changed files with 21 additions and 2 deletions

12
configure vendored
View File

@ -364,6 +364,7 @@ function load_default_config() {
GENTOO_MIRROR="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo"
GENTOO_ARCH="amd64"
USE_PORTAGE_TESTING=true
SELECT_MIRRORS=false
SELECT_MIRRORS_LARGE_FILE=false
@ -761,6 +762,7 @@ MENU_ITEMS=(
"PORTAGE_GIT_MIRROR"
"GENTOO_MIRROR"
"GENTOO_ARCH"
"USE_PORTAGE_TESTING"
"SELECT_MIRRORS"
"SELECT_MIRRORS_LARGE_FILE"
"--------"
@ -1222,6 +1224,15 @@ function GENTOO_ARCH_menu() {
fi
}
function USE_PORTAGE_TESTING_tag() { echo "Run mirrorselect"; }
function USE_PORTAGE_TESTING_label() { on_off_label "$USE_PORTAGE_TESTING"; }
function USE_PORTAGE_TESTING_show() { return 0; }
function USE_PORTAGE_TESTING_help() { echo "Determines if the system should use bleeding edge software from the respective architecture's testing branch. This will add ACCEPT_KEYWORDS=\"~\$GENTOO_ARCH\" to /etc/portage/make.conf"; }
function USE_PORTAGE_TESTING_menu() {
on_off_toggle "USE_PORTAGE_TESTING"
UNSAVED_CHANGES=true
}
function SELECT_MIRRORS_tag() { echo "Run mirrorselect"; }
function SELECT_MIRRORS_label() { on_off_label "$SELECT_MIRRORS"; }
function SELECT_MIRRORS_show() { return 0; }
@ -1340,6 +1351,7 @@ PORTAGE_GIT_MIRROR=${PORTAGE_GIT_MIRROR@Q}
GENTOO_MIRROR=${GENTOO_MIRROR@Q}
GENTOO_ARCH=${GENTOO_ARCH@Q}
STAGE3_BASENAME="stage3-\$GENTOO_ARCH$([[ $SYSTEMD == true ]] && echo -n "-systemd" || echo -n "-openrc")"
USE_PORTAGE_TESTING=${USE_PORTAGE_TESTING@Q}
SELECT_MIRRORS=${SELECT_MIRRORS@Q}
SELECT_MIRRORS_LARGE_FILE=${SELECT_MIRRORS_LARGE_FILE@Q}

View File

@ -228,6 +228,10 @@ STAGE3_BASENAME="stage3-$GENTOO_ARCH-systemd"
#STAGE3_BASENAME="stage3-$GENTOO_ARCH-desktop-systemd"
#STAGE3_BASENAME="stage3-$GENTOO_ARCH-desktop-openrc"
# If set to true, the installer will add ACCEPT_KEYWORDS="~$GENTOO_ARCH"
# to /etc/portage/make.conf to enable packages in testing.
USE_PORTAGE_TESTING=true
# If set to true, the best best gentoo mirrors will be selected
# automatically by app-portage/mirrorselect
SELECT_MIRRORS=true

View File

@ -86,13 +86,16 @@ function configure_portage() {
[[ $SELECT_MIRRORS_LARGE_FILE == "true" ]] \
&& mirrorselect_params+=("-D")
try mirrorselect "${mirrorselect_params[@]}"
fi
if [[ $USE_PORTAGE_TESTING == "true" ]]; then
einfo "Adding ~$GENTOO_ARCH to ACCEPT_KEYWORDS"
echo "ACCEPT_KEYWORDS=\"~$GENTOO_ARCH\"" >> /etc/portage/make.conf \
|| die "Could not modify /etc/portage/make.conf"
chmod 644 /etc/portage/make.conf \
|| die "Could not chmod 644 /etc/portage/make.conf"
fi
chmod 644 /etc/portage/make.conf \
|| die "Could not chmod 644 /etc/portage/make.conf"
}
function install_sshd() {