From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A4285138010 for ; Thu, 1 Nov 2012 11:54:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8D70E21C0CE; Thu, 1 Nov 2012 11:54:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 0139221C0CE for ; Thu, 1 Nov 2012 11:54:03 +0000 (UTC) Received: from pomiocik.lan (213-238-96-169.adsl.inetia.pl [213.238.96.169]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 355AD33D963; Thu, 1 Nov 2012 11:54:02 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-python@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-python] [PATCH eselect-python 2/2] Re-set the same interpreters on 'update --if-unset'. Date: Thu, 1 Nov 2012 12:54:53 +0100 Message-Id: <1351770893-1217-2-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1351770893-1217-1-git-send-email-mgorny@gentoo.org> References: <1351770893-1217-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org X-Archives-Salt: a39527c4-ea0f-4798-9b9a-7f7bc55d8b46 X-Archives-Hash: 8156e5584ad9b4f46bffc50251b43abf This will handle migrating/fixing user settings. In this particular case, it's needed to write /etc/env.d/python/python* files on eselect-python upgrade. --- python.eselect | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python.eselect b/python.eselect index 8d4858a..f69d5df 100644 --- a/python.eselect +++ b/python.eselect @@ -382,10 +382,16 @@ do_update() { if [[ "${if_unset}" == "1" && -f "${INTERPRETER_PATH}python" && -f "${ENV_D_PATH}/python/config" ]]; then if [[ "${python2}" == "1" && -f "${INTERPRETER_PATH}python2" ]]; then - return + target="$(readlink "${INTERPRETER_PATH}python2")" elif [[ "${python3}" == "1" && -f "${INTERPRETER_PATH}python3" ]]; then - return + target="$(readlink "${INTERPRETER_PATH}python3")" elif [[ "${python2}" == "0" && "${python3}" == "0" ]]; then + target="$(<"${ENV_D_PATH}/python/config")" + fi + + if [[ ${target} ]]; then + echo "Resetting ${target}" + do_set ${python_version_option} ${target} return fi fi -- 1.7.12.4