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 81A911381F3 for ; Fri, 6 Sep 2013 11:11:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B2C73E102C; Fri, 6 Sep 2013 11:11:01 +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 2A452E102C for ; Fri, 6 Sep 2013 11:11:01 +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 0EE2C33EB6D for ; Fri, 6 Sep 2013 11:11:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id BBE3BE5463 for ; Fri, 6 Sep 2013 11:10:58 +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: <1378465737.da689634856bb83123b209fab64106e2937d4ba6.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/tools/, roverlay/config/, roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/argparser.py roverlay/config/const.py roverlay/tools/shenv.py X-VCS-Directories: roverlay/tools/ roverlay/config/ roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: da689634856bb83123b209fab64106e2937d4ba6 X-VCS-Branch: master Date: Fri, 6 Sep 2013 11:10:58 +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: 1f1d5d3d-f20a-48f7-9ca2-72a9bc51c213 X-Archives-Hash: 33ce81dc973d039b04521c7f47eb3d37 commit: da689634856bb83123b209fab64106e2937d4ba6 Author: André Erdmann mailerd de> AuthorDate: Fri Sep 6 11:08:57 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Fri Sep 6 11:08:57 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=da689634 roverlay: --sync-in-hooks allows syncing in hooks (ignores --no-sync and sets NOSYNC=n).t --- roverlay/argparser.py | 7 +++++++ roverlay/config/const.py | 7 ++++--- roverlay/tools/shenv.py | 12 +++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/roverlay/argparser.py b/roverlay/argparser.py index e1ded67..ed0561c 100644 --- a/roverlay/argparser.py +++ b/roverlay/argparser.py @@ -147,6 +147,7 @@ class RoverlayArgumentParserBase ( roverlay.argutil.ArgumentParserProxy ): self.do_extraconf ( (), 'REPO.config_files' ) self.do_extraconf ( True, 'nosync' ) + conf_ifdef ( 'sync_in_hooks', 'sync_in_hooks' ) # overlay creation conf_ifdef ( 'distmap_verify', 'OVERLAY.DISTDIR.verify' ) @@ -424,6 +425,12 @@ class RoverlayArgumentParserBase ( roverlay.argutil.ArgumentParserProxy ): ) arg ( + '--sync-in-hooks', dest='sync_in_hooks', default=argparse.SUPPRESS, + flags=self.ARG_WITH_DEFAULT|self.ARG_OPT_IN, + help='allow syncing in hooks even if sync is forbidden', + ) + + arg ( '--distroot', dest='distroot', default=argparse.SUPPRESS, flags=self.ARG_WITH_DEFAULT|self.ARG_META_DIR, type=couldbe_fs_dir, diff --git a/roverlay/config/const.py b/roverlay/config/const.py index f6492d7..20e5aad 100644 --- a/roverlay/config/const.py +++ b/roverlay/config/const.py @@ -12,9 +12,10 @@ import time __all__ = [ 'clone', 'lookup' ] _CONSTANTS = dict ( - debug = False, - nosync = False, - #installed = False, + debug = False, + nosync = False, + #sync_in_hooks = None, + #installed = False, portdir = '/usr/portage', diff --git a/roverlay/tools/shenv.py b/roverlay/tools/shenv.py index 27566e8..5587e6d 100644 --- a/roverlay/tools/shenv.py +++ b/roverlay/tools/shenv.py @@ -99,9 +99,11 @@ NULL_PHASE = 'null' SH_TRUE = 'y' SH_FALSE = 'n' -def shbool ( value ): +def shbool ( value, flip=False ): """Converts value into a shbool.""" - return SH_TRUE if value else SH_FALSE + # SH_TRUE := value XOR invert + # -> SH_FALSE := value <=> invert + return SH_FALSE if bool ( value ) is bool ( flip ) else SH_TRUE # --- end of shbool (...) --- def get_shbool ( value, empty_is_false=True, undef_is_false=True ): @@ -295,7 +297,11 @@ def setup_env(): setup_self ( 'GIT_ASKPASS', 'GIT_EDITOR' ) # shbool $NOSYNC - setup ( 'NOSYNC', shbool ( roverlay.config.get_or_fail ( 'nosync' ) ) ) + sync_in_hooks = roverlay.config.get ( 'sync_in_hooks', None ) + if sync_in_hooks is None: + setup ( 'NOSYNC', shbool ( roverlay.config.get_or_fail ( 'nosync' ) ) ) + else: + setup ( 'NOSYNC', shbool ( not sync_in_hooks ) ) # shbool $NO_COLOR #