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 297C11381F3 for ; Mon, 15 Jul 2013 22:31:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CB7AAE09C3; Mon, 15 Jul 2013 22:31:50 +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 2BDE7E09C3 for ; Mon, 15 Jul 2013 22:31:50 +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 2C38133E7C5 for ; Mon, 15 Jul 2013 22:31:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id C663EE5462 for ; Mon, 15 Jul 2013 22:31:47 +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: <1373927345.6e32f77915e8bf388059f79750a5a30bf8d2fb49.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:gsoc13/next commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/hook.py roverlay/main.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 6e32f77915e8bf388059f79750a5a30bf8d2fb49 X-VCS-Branch: gsoc13/next Date: Mon, 15 Jul 2013 22:31:47 +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: 808fad36-0f4a-4f80-aca8-8fcdc726a512 X-Archives-Hash: d0364472e89c60f6e0cea5bc685614df commit: 6e32f77915e8bf388059f79750a5a30bf8d2fb49 Author: André Erdmann mailerd de> AuthorDate: Mon Jul 15 22:29:05 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Jul 15 22:29:05 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=6e32f779 --run-script: respect EvENT_HOOK_RESTRICT --- roverlay/hook.py | 4 ++-- roverlay/main.py | 25 +++++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/roverlay/hook.py b/roverlay/hook.py index e56aa33..262d3c2 100644 --- a/roverlay/hook.py +++ b/roverlay/hook.py @@ -32,12 +32,12 @@ _EVENT_POLICY = 0 class HookException ( Exception ): pass -def setup(): +def setup ( force=False ): global _EVENT_SCRIPT global _EVENT_POLICY global _EVENT_RESTRICT - if roverlay.config.get ( 'write_disabled', False ): + if roverlay.config.get ( 'write_disabled', False ) and not force: _EVENT_SCRIPT = False return diff --git a/roverlay/main.py b/roverlay/main.py index 24c02c6..7a88171 100644 --- a/roverlay/main.py +++ b/roverlay/main.py @@ -497,16 +497,21 @@ def main ( if do_runscript: import roverlay.tools.shenv - sys.exit ( - roverlay.tools.shenv.run_script ( - script = extra_opts ['run_script'], - phase = "user", - argv = extra_opts ['run_script_args'], - return_success = False, - log_output = False, - initial_dir = os.getcwd(), - ).returncode - ) + import roverlay.hook + roverlay.hook.setup ( force=True ) + if roverlay.hook.phase_allowed ( "user" ): + sys.exit ( + roverlay.tools.shenv.run_script ( + script = extra_opts ['run_script'], + phase = "user", + argv = extra_opts ['run_script_args'], + return_success = False, + log_output = False, + initial_dir = os.getcwd(), + ).returncode + ) + else: + die ( "--run-script: 'user' phase is not allowed." ) elif do_setupdirs: sys.exit ( run_setupdirs ( conf, extra_opts['target_uid'], extra_opts['target_gid'] 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 C07721381F3 for ; Tue, 16 Jul 2013 16:36:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5DA49E0A9B; Tue, 16 Jul 2013 16:36:32 +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 C0E34E0A9B for ; Tue, 16 Jul 2013 16:36:31 +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 CBD6333E9C3 for ; Tue, 16 Jul 2013 16:36:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6E85AE5462 for ; Tue, 16 Jul 2013 16:36:29 +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: <1373927345.6e32f77915e8bf388059f79750a5a30bf8d2fb49.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/hook.py roverlay/main.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 6e32f77915e8bf388059f79750a5a30bf8d2fb49 X-VCS-Branch: master Date: Tue, 16 Jul 2013 16:36:29 +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: 23b28217-921f-48e5-85b1-e76c0480c2ef X-Archives-Hash: 8c02b53a542ede40e059abacd02dd9b8 Message-ID: <20130716163629.iyrsClHxpqC31ed9kBJMfucWkDaiT1v6SxR_88wCKII@z> commit: 6e32f77915e8bf388059f79750a5a30bf8d2fb49 Author: André Erdmann mailerd de> AuthorDate: Mon Jul 15 22:29:05 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Jul 15 22:29:05 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=6e32f779 --run-script: respect EvENT_HOOK_RESTRICT --- roverlay/hook.py | 4 ++-- roverlay/main.py | 25 +++++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/roverlay/hook.py b/roverlay/hook.py index e56aa33..262d3c2 100644 --- a/roverlay/hook.py +++ b/roverlay/hook.py @@ -32,12 +32,12 @@ _EVENT_POLICY = 0 class HookException ( Exception ): pass -def setup(): +def setup ( force=False ): global _EVENT_SCRIPT global _EVENT_POLICY global _EVENT_RESTRICT - if roverlay.config.get ( 'write_disabled', False ): + if roverlay.config.get ( 'write_disabled', False ) and not force: _EVENT_SCRIPT = False return diff --git a/roverlay/main.py b/roverlay/main.py index 24c02c6..7a88171 100644 --- a/roverlay/main.py +++ b/roverlay/main.py @@ -497,16 +497,21 @@ def main ( if do_runscript: import roverlay.tools.shenv - sys.exit ( - roverlay.tools.shenv.run_script ( - script = extra_opts ['run_script'], - phase = "user", - argv = extra_opts ['run_script_args'], - return_success = False, - log_output = False, - initial_dir = os.getcwd(), - ).returncode - ) + import roverlay.hook + roverlay.hook.setup ( force=True ) + if roverlay.hook.phase_allowed ( "user" ): + sys.exit ( + roverlay.tools.shenv.run_script ( + script = extra_opts ['run_script'], + phase = "user", + argv = extra_opts ['run_script_args'], + return_success = False, + log_output = False, + initial_dir = os.getcwd(), + ).returncode + ) + else: + die ( "--run-script: 'user' phase is not allowed." ) elif do_setupdirs: sys.exit ( run_setupdirs ( conf, extra_opts['target_uid'], extra_opts['target_gid']