From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 28703138330 for ; Tue, 9 Jan 2018 08:32:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 409E2E081E; Tue, 9 Jan 2018 08:32:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 239A1E081E for ; Tue, 9 Jan 2018 08:32:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B4C84335C39 for ; Tue, 9 Jan 2018 08:32:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D407D198 for ; Tue, 9 Jan 2018 08:32:17 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1515485761.4bd139a86d73388dfdc6cbcf553f59b3ffa1138e.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: modules/, / X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog modules/profile.eselect X-VCS-Directories: modules/ / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 4bd139a86d73388dfdc6cbcf553f59b3ffa1138e X-VCS-Branch: master Date: Tue, 9 Jan 2018 08:32:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 49f8f5a0-1417-44ea-8bf5-9fea0e66bbb4 X-Archives-Hash: ac8800cb52976ecec2ed4785081c5f23 commit: 4bd139a86d73388dfdc6cbcf553f59b3ffa1138e Author: Ulrich Müller gentoo org> AuthorDate: Tue Jan 9 08:16:01 2018 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue Jan 9 08:16:01 2018 +0000 URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=4bd139a8 Require --force option when selecting an experimental profile. * modules/profile.eselect (set_symlink): Require --force option when selecting an experimental profile. ChangeLog | 5 +++++ modules/profile.eselect | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 57e768e..0be1bc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-01-09 Ulrich Müller + + * modules/profile.eselect (set_symlink): Require --force option + when selecting an experimental profile. + 2018-01-08 Ulrich Müller * 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