diff options
author | Ulrich Müller <ulm@gentoo.org> | 2018-01-09 09:16:01 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2018-01-09 09:16:01 +0100 |
commit | 4bd139a86d73388dfdc6cbcf553f59b3ffa1138e (patch) | |
tree | a1f254637d3280be3f8cb5fa94efeb7b373cefcf /modules | |
parent | Show the profiles' status in the profile module's list output. (diff) | |
download | eselect-4bd139a86d73388dfdc6cbcf553f59b3ffa1138e.tar.gz eselect-4bd139a86d73388dfdc6cbcf553f59b3ffa1138e.tar.bz2 eselect-4bd139a86d73388dfdc6cbcf553f59b3ffa1138e.zip |
Require --force option when selecting an experimental profile.
* modules/profile.eselect (set_symlink): Require --force option
when selecting an experimental profile.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/profile.eselect | 7 |
1 files changed, 6 insertions, 1 deletions
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 |