From 603d7e41b062c3371a626ce2bcd15870d2c8a433 Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 2 Dec 2020 19:05:41 -0600 Subject: [PATCH] Modularize profile selection --- gentoostrap.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gentoostrap.sh b/gentoostrap.sh index cb85b3b..da0bc2a 100755 --- a/gentoostrap.sh +++ b/gentoostrap.sh @@ -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"