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 378321381F3 for ; Wed, 7 Aug 2013 16:10:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26D8EE0A82; Wed, 7 Aug 2013 16:10:15 +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 A4387E0A82 for ; Wed, 7 Aug 2013 16:10:14 +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 A02B133EAF3 for ; Wed, 7 Aug 2013 16:10:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 1D3E3E5463 for ; Wed, 7 Aug 2013 16:10:12 +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: <1375890056.1feee9c63998b09147f9de18c4e39c5f97f8e067.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/argutil.py roverlay/main.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 1feee9c63998b09147f9de18c4e39c5f97f8e067 X-VCS-Branch: master Date: Wed, 7 Aug 2013 16:10:12 +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: 2fe5f740-7063-4d9a-9f93-f952b6eca446 X-Archives-Hash: 6893fb011c0266fe989a4d5edae051cf commit: 1feee9c63998b09147f9de18c4e39c5f97f8e067 Author: André Erdmann mailerd de> AuthorDate: Wed Aug 7 15:40:56 2013 +0000 Commit: André Erdmann mailerd de> CommitDate: Wed Aug 7 15:40:56 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=1feee9c6 roverlay: --strict[-sync] --strict-sync: exit (call die()) if sync doesn't succeed --strict: enable all --strict- switches --- roverlay/argutil.py | 16 ++++++++++++++++ roverlay/main.py | 8 +++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/roverlay/argutil.py b/roverlay/argutil.py index 0f0b593..13f23df 100644 --- a/roverlay/argutil.py +++ b/roverlay/argutil.py @@ -331,6 +331,20 @@ def get_parser ( command_map, default_config_file, default_command='create' ): ) arg ( + '--strict', + help='enable all --strict- options', + default=False, + action='store_true', + ) + + arg ( + '--strict-sync', + help='exit on any sync errors', + default=False, + action='store_true', + ) + + arg ( '--nosync', '--no-sync', default=argparse.SUPPRESS, help="disable syncing with remotes (offline mode).", action='store_true', @@ -510,6 +524,8 @@ def parse_argv ( command_map, **kw ): target_gid = p.target_gid, dump_stats = p.dump_stats, sync_imported = p.sync_imported, + strict = p.strict, + strict_sync = p.strict_sync, ) diff --git a/roverlay/main.py b/roverlay/main.py index 4954645..4a65aee 100644 --- a/roverlay/main.py +++ b/roverlay/main.py @@ -120,6 +120,9 @@ def main ( def run_sync(): if "sync" in actions_done: return + + STRICT_SYNC = OPTION ( 'strict' ) or OPTION ( 'strict_sync' ) + try: # set up the repo list global repo_list @@ -136,7 +139,7 @@ def main ( repo_list.load() ## this runs _nosync() or _sync(), depending on extra_opts->nosync - repo_list.sync() + sync_success = repo_list.sync ( fail_greedy=STRICT_SYNC ) set_action_done ( "sync" ) except KeyboardInterrupt: @@ -149,6 +152,9 @@ def main ( ) else: raise + else: + if not sync_success and STRICT_SYNC: + die ( "errors occured while syncing.", DIE.SYNC ) # --- end of run_sync() --- def run_apply_package_rules():