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 1C81F1381F3 for ; Fri, 13 Sep 2013 15:20:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE6B8E0BA5; Fri, 13 Sep 2013 15:20:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 36C8EE0BA5 for ; Fri, 13 Sep 2013 15:20:48 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E28C633EC7F for ; Fri, 13 Sep 2013 15:20:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 96EE2E468F for ; Fri, 13 Sep 2013 15:20:45 +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: <1379085569.60a9c209e4c43ec6de3437c3c26ed036b7976f56.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/setupscript/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/setupscript/hookenv.py roverlay/setupscript/runtime.py X-VCS-Directories: roverlay/setupscript/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 60a9c209e4c43ec6de3437c3c26ed036b7976f56 X-VCS-Branch: master Date: Fri, 13 Sep 2013 15:20:45 +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: 8044cf2d-896d-45eb-8cbe-ece063df4564 X-Archives-Hash: 927a8c3ee894e174f39e782f81357d9d commit: 60a9c209e4c43ec6de3437c3c26ed036b7976f56 Author: André Erdmann mailerd de> AuthorDate: Fri Sep 13 15:19:29 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Fri Sep 13 15:19:29 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=60a9c209 setupscript: --[no-]relpath-hooks Controls whether links with absolute/relative paths are created. Defaults to absolute if installed and relative if not. --- roverlay/setupscript/hookenv.py | 15 +++++++++++---- roverlay/setupscript/runtime.py | 13 +++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/roverlay/setupscript/hookenv.py b/roverlay/setupscript/hookenv.py index 5ffcbdd..001e9cd 100644 --- a/roverlay/setupscript/hookenv.py +++ b/roverlay/setupscript/hookenv.py @@ -674,12 +674,19 @@ class SetupHookEnvironment ( to_link.append ( ( script, dest_name, link ) ) # -- end for - register_link = self.user_hooks.register_hook_link_unsafe - symlink = self.setup_env.private_file.symlink - success = True + register_link = self.user_hooks.register_hook_link_unsafe + symlink = self.setup_env.private_file.symlink + relative_links = self.setup_env.options ['hook_relpath'] + success = True for script, dest_name, link in to_link: - have_link = symlink ( script.fspath, link ) + if relative_links: + have_link = symlink ( + os.path.relpath ( script.fspath, destdir ), link + ) + else: + have_link = symlink ( script.fspath, link ) + if have_link: register_link ( event_name, script, link, dest_name ) elif have_link is not None: diff --git a/roverlay/setupscript/runtime.py b/roverlay/setupscript/runtime.py index 43733a3..6ce804b 100644 --- a/roverlay/setupscript/runtime.py +++ b/roverlay/setupscript/runtime.py @@ -243,6 +243,17 @@ class SetupArgParser ( roverlay.argparser.RoverlayArgumentParser ): ), ) + arg ( + '--relpath-hooks', dest='hook_relpath', + flags=self.ARG_WITH_DEFAULT|self.ARG_OPT_IN, + help='create hook links with relative paths', + ) + arg ( + '--no-relpath-hooks', dest='hook_relpath', + flags=self.ARG_SHARED_INVERSE|self.ARG_OPT_OUT, + help='create hook links with absolute paths', + ) + return arg # --- end of setup_hooks (...) --- @@ -293,6 +304,7 @@ class SetupEnvironment ( roverlay.runtime.IndependentRuntimeEnvironment ): 'private_conf_root' : instinfo ['workroot'] + os.sep + 'config', 'import_config' : 'symlink=root', 'additions_dir' : instinfo ['workroot'] + os.sep + 'files', + 'hook_relpath' : False, } else: assert self.prjroot @@ -304,6 +316,7 @@ class SetupEnvironment ( roverlay.runtime.IndependentRuntimeEnvironment ): 'private_conf_root' : prjroot + 'config', 'import_config' : 'disable', 'additions_dir' : prjroot + 'files', + 'hook_relpath' : True, } # --- end of get_parser_defaults (...) ---