Modularize profile selection

This commit is contained in:
Salt 2020-12-02 19:05:41 -06:00
parent 34fcf638d5
commit 603d7e41b0

View File

@ -13,6 +13,7 @@ declare -r _name="$(basename -- "$0")"
# Options # Options
declare -i _optchroot declare -i _optchroot
declare _optdest="/mnt" declare _optdest="/mnt"
declare _optprofile="desktop"
declare -i _opthelp declare -i _opthelp
declare -i _optverbose declare -i _optverbose
# Working variables # Working variables
@ -149,12 +150,13 @@ build-gentoo-chroot() {
profile=$( profile=$(
eselect profile list \ eselect profile list \
| grep -ie 'stable' \ | grep -ie 'stable' \
| grep -ie 'plasma/systemd' \ | grep -ie "$profile" \
| sort \ | sort \
| uniq \ | uniq \
| head -n 1 \ | head -n 1 \
| grep -oP '\[\K[^\]]+' | grep -oP '\[\K[^\]]+'
) ) || error "Error finding profile: $profile" 51
[ -z "$profile" ] && error "Could not find profile: $profile" 52
log "Setting profile $profile" log "Setting profile $profile"
eselect profile set "$profile" eselect profile set "$profile"