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 E3D6E138E20 for ; Fri, 21 Feb 2014 17:37:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 30D51E0F23; Fri, 21 Feb 2014 17:36:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B6425E0F23 for ; Fri, 21 Feb 2014 17:36:57 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 86EB533FAAB for ; Fri, 21 Feb 2014 17:36:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 2D27A188C8 for ; Fri, 21 Feb 2014 17:36:55 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1392931228.796c1d77dafadccc44e028d91366228502af4416.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/setupscript/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/setupscript/initenv.py X-VCS-Directories: roverlay/setupscript/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 796c1d77dafadccc44e028d91366228502af4416 X-VCS-Branch: master Date: Fri, 21 Feb 2014 17:36:55 +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: a0cf1a92-ea15-4bfc-9eb3-5fc17eec0401 X-Archives-Hash: e745de8d5074dc6251b3a12eed551afb commit: 796c1d77dafadccc44e028d91366228502af4416 Author: André Erdmann mailerd de> AuthorDate: Thu Feb 20 21:20:28 2014 +0000 Commit: André Erdmann mailerd de> CommitDate: Thu Feb 20 21:20:28 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=796c1d77 roverlay-setup, config import: minor improvement fs_ops.unlink() always succeeds in --pretend mode (no-op), so "roverlay-setup --pretend" gives misleading output when user_config_root==config_root. => do not reset user_conf_root in --pretend mode if it isn't a symlink. --- roverlay/setupscript/initenv.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/roverlay/setupscript/initenv.py b/roverlay/setupscript/initenv.py index 58677e1..ef06436 100644 --- a/roverlay/setupscript/initenv.py +++ b/roverlay/setupscript/initenv.py @@ -186,15 +186,11 @@ class SetupInitEnvironment ( # assert os.path.isdir ( os.path.dirname(user_conf_root) == work_root ) if user_conf_root is None and ( - fs_ops.unlink ( setup_env.user_conf_root ) + not pretend or os.path.islink ( setup_env.user_conf_root ) ): - # config_root was a symlink - - if pretend: - user_conf_root = setup_env.user_conf_root - else: + if fs_ops.unlink ( setup_env.user_conf_root ): + # user_conf_root was a symlink user_conf_root = setup_env.get_user_config_root() - # -- end if