public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/tools/, roverlay/config/, roverlay/
Date: Fri,  6 Sep 2013 11:10:58 +0000 (UTC)	[thread overview]
Message-ID: <1378465737.da689634856bb83123b209fab64106e2937d4ba6.dywi@gentoo> (raw)

commit:     da689634856bb83123b209fab64106e2937d4ba6
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Sep  6 11:08:57 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> 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
    #


             reply	other threads:[~2013-09-06 11:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06 11:10 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-09-05 10:24 [gentoo-commits] proj/R_overlay:master commit in: roverlay/tools/, roverlay/config/, roverlay/ André Erdmann
2013-06-30 15:58 André Erdmann
2013-06-26 17:29 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-30 15:58 ` [gentoo-commits] proj/R_overlay:master " André Erdmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378465737.da689634856bb83123b209fab64106e2937d4ba6.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox