aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2018-01-09 09:16:01 +0100
committerUlrich Müller <ulm@gentoo.org>2018-01-09 09:16:01 +0100
commit4bd139a86d73388dfdc6cbcf553f59b3ffa1138e (patch)
treea1f254637d3280be3f8cb5fa94efeb7b373cefcf
parentShow the profiles' status in the profile module's list output. (diff)
downloadeselect-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.
-rw-r--r--ChangeLog5
-rw-r--r--modules/profile.eselect7
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 57e768e..0be1bc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-09 Ulrich Müller <ulm@gentoo.org>
+
+ * modules/profile.eselect (set_symlink): Require --force option
+ when selecting an experimental profile.
+
2018-01-08 Ulrich Müller <ulm@gentoo.org>
* modules/profile.eselect (find_targets): Add a fourth field for
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