Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/eselect:master commit in: modules/, /
Date: Tue, 09 Jan 2018 08:32:24
Message-Id: 1515485761.4bd139a86d73388dfdc6cbcf553f59b3ffa1138e.ulm@gentoo
1 commit: 4bd139a86d73388dfdc6cbcf553f59b3ffa1138e
2 Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 9 08:16:01 2018 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 9 08:16:01 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=4bd139a8
7
8 Require --force option when selecting an experimental profile.
9
10 * modules/profile.eselect (set_symlink): Require --force option
11 when selecting an experimental profile.
12
13 ChangeLog | 5 +++++
14 modules/profile.eselect | 7 ++++++-
15 2 files changed, 11 insertions(+), 1 deletion(-)
16
17 diff --git a/ChangeLog b/ChangeLog
18 index 57e768e..0be1bc4 100644
19 --- a/ChangeLog
20 +++ b/ChangeLog
21 @@ -1,3 +1,8 @@
22 +2018-01-09 Ulrich Müller <ulm@g.o>
23 +
24 + * modules/profile.eselect (set_symlink): Require --force option
25 + when selecting an experimental profile.
26 +
27 2018-01-08 Ulrich Müller <ulm@g.o>
28
29 * modules/profile.eselect (find_targets): Add a fourth field for
30
31 diff --git a/modules/profile.eselect b/modules/profile.eselect
32 index de85f90..1e1dcff 100644
33 --- a/modules/profile.eselect
34 +++ b/modules/profile.eselect
35 @@ -75,7 +75,7 @@ remove_symlink() {
36
37 # set the make.profile symlink
38 set_symlink() {
39 - local target=$1 force=$2 targets arch parch repo repopath
40 + local target=$1 force=$2 targets arch parch repo repopath status
41
42 if is_number "${target}"; then
43 targets=( $(find_targets) )
44 @@ -86,7 +86,12 @@ set_symlink() {
45 target=${targets[target-1]}
46 repo=${target%%::*}; target=${target#*::}
47 repopath=${target%%::*}; target=${target#*::}
48 + status=${target#*::}; status=${status%%::*}
49 target=${target%%::*}
50 + if [[ ${status} == exp && -z ${force} ]]; then
51 + write_error_msg "Profile ${target} is experimental"
52 + die -q "Refusing to select ${status} profile without --force option"
53 + fi
54 elif [[ -n ${target} ]]; then
55 # if the profile was explicitly specified (rather than a number)
56 # double check and make sure it's valid