From 4bd139a86d73388dfdc6cbcf553f59b3ffa1138e Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Tue, 9 Jan 2018 09:16:01 +0100 Subject: Require --force option when selecting an experimental profile. * modules/profile.eselect (set_symlink): Require --force option when selecting an experimental profile. --- modules/profile.eselect | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/profile.eselect b/modules/profile.eselect index de85f90..1e1dcff 100644 --- a/modules/profile.eselect +++ b/modules/profile.eselect @@ -75,7 +75,7 @@ remove_symlink() { # set the make.profile symlink set_symlink() { - local target=$1 force=$2 targets arch parch repo repopath + local target=$1 force=$2 targets arch parch repo repopath status if is_number "${target}"; then targets=( $(find_targets) ) @@ -86,7 +86,12 @@ set_symlink() { target=${targets[target-1]} repo=${target%%::*}; target=${target#*::} repopath=${target%%::*}; target=${target#*::} + status=${target#*::}; status=${status%%::*} target=${target%%::*} + if [[ ${status} == exp && -z ${force} ]]; then + write_error_msg "Profile ${target} is experimental" + die -q "Refusing to select ${status} profile without --force option" + fi elif [[ -n ${target} ]]; then # if the profile was explicitly specified (rather than a number) # double check and make sure it's valid -- cgit v1.2.3-65-gdbad