From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SNsGO-0001J0-CP for garchives@archives.gentoo.org; Fri, 27 Apr 2012 20:59:37 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 89751E0A5F; Fri, 27 Apr 2012 20:59:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4AA59E0A5F for ; Fri, 27 Apr 2012 20:59:29 +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 7E7331B402E for ; Fri, 27 Apr 2012 20:59:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3FA8AE5402 for ; Fri, 27 Apr 2012 20:59:27 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1335560328.cfa1e254447b719a2a3fc59d7ecd9c0e933feefb.zorry@gentoo> Subject: [gentoo-commits] dev/zorry:master commit in: gobs/bin/, gobs/pym/ X-VCS-Repository: dev/zorry X-VCS-Files: gobs/bin/gobs_updatedb gobs/bin/gobs_updatedb~ gobs/pym/sync.py X-VCS-Directories: gobs/bin/ gobs/pym/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: cfa1e254447b719a2a3fc59d7ecd9c0e933feefb X-VCS-Branch: master Date: Fri, 27 Apr 2012 20:59:27 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: a390bdcc-dc4e-49cc-9381-f9e5af7a4e6b X-Archives-Hash: 9ce5a7e2d9c3fb56fdf80a2b28ba2e13 commit: cfa1e254447b719a2a3fc59d7ecd9c0e933feefb Author: Magnus Granberg gentoo org> AuthorDate: Fri Apr 27 20:58:48 2012 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Fri Apr 27 20:58:48 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/zorry.git;a=3D= commit;h=3Dcfa1e254 Add logging sync.py --- gobs/bin/gobs_updatedb | 15 ++++++++------- gobs/bin/{gobs_updatedb =3D> gobs_updatedb~} | 12 ++++++------ gobs/pym/sync.py | 14 +++++++++++--- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/gobs/bin/gobs_updatedb b/gobs/bin/gobs_updatedb index 4fba322..babaf38 100755 --- a/gobs/bin/gobs_updatedb +++ b/gobs/bin/gobs_updatedb @@ -114,14 +114,15 @@ def main(): # Main # Logging logging.basicConfig(filename=3Dgobs_settings_dict['gobs_logfile'], leve= l=3Dlogging.INFO) - # Init settings for the default config + # Sync portage and profile/settings git_pull - if sync_tree(): - mysettings =3D init_portage_settings() - init_arch =3D gobs_arch() - init_arch.update_arch_db() - # Update the cpv db - update_cpv_db(mysettings) + sync_tree() + # Init settings for the default config + mysettings =3D init_portage_settings() + init_arch =3D gobs_arch() + init_arch.update_arch_db() + # Update the cpv db + update_cpv_db(mysettings) CM.closeAllConnections() =09 if __name__ =3D=3D "__main__": diff --git a/gobs/bin/gobs_updatedb b/gobs/bin/gobs_updatedb~ similarity index 96% copy from gobs/bin/gobs_updatedb copy to gobs/bin/gobs_updatedb~ index 4fba322..4dce5ce 100755 --- a/gobs/bin/gobs_updatedb +++ b/gobs/bin/gobs_updatedb~ @@ -116,12 +116,12 @@ def main(): logging.basicConfig(filename=3Dgobs_settings_dict['gobs_logfile'], leve= l=3Dlogging.INFO) # Init settings for the default config git_pull - if sync_tree(): - mysettings =3D init_portage_settings() - init_arch =3D gobs_arch() - init_arch.update_arch_db() - # Update the cpv db - update_cpv_db(mysettings) + sync_tree() + mysettings =3D init_portage_settings() + init_arch =3D gobs_arch() + init_arch.update_arch_db() + # Update the cpv db + update_cpv_db(mysettings) CM.closeAllConnections() =09 if __name__ =3D=3D "__main__": diff --git a/gobs/pym/sync.py b/gobs/pym/sync.py index cfaebfe..22ff5e7 100644 --- a/gobs/pym/sync.py +++ b/gobs/pym/sync.py @@ -2,6 +2,8 @@ from __future__ import print_function import portage import os import errno +import logging +import sys from git import * from _emerge.actions import load_emerge_config, action_sync from _emerge.main import parse_opts @@ -20,6 +22,12 @@ def sync_tree(): tmpcmdline.append("--sync") tmpcmdline.append("--quiet") myaction, myopts, myfiles =3D parse_opts(tmpcmdline) - fail_sync =3D action_sync(settings, trees, mtimedb, myopts, myaction) - print("fail_sync", fail_sync) - return fail_sync \ No newline at end of file + logging.info("Eemerge --sync") + fail_sync =3D 1 + #fail_sync =3D action_sync(settings, trees, mtimedb, myopts, myaction) + if fail_sync is True: + logging.warning("Emerge --sync fail!") + sys.exit() + else: + logging.info("Emerge --sync ... Done." + sys.exit() \ No newline at end of file