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