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 1SO8DP-0002g0-Kp for garchives@archives.gentoo.org; Sat, 28 Apr 2012 14:01:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C2A4FE0920; Sat, 28 Apr 2012 14:01:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 974B6E0920 for ; Sat, 28 Apr 2012 14:01:17 +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 03A491B4011 for ; Sat, 28 Apr 2012 14:01:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id BED4FE5402 for ; Sat, 28 Apr 2012 14:01:14 +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: <1335621664.e147d01855031095e123178d50e88d7ae1efcb34.zorry@gentoo> Subject: [gentoo-commits] dev/zorry:master commit in: gobs/pym/ X-VCS-Repository: dev/zorry X-VCS-Files: gobs/pym/sync.py X-VCS-Directories: gobs/pym/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: e147d01855031095e123178d50e88d7ae1efcb34 X-VCS-Branch: master Date: Sat, 28 Apr 2012 14:01:14 +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: 5638af18-d52d-4ff7-a5c9-73b6e0df36e4 X-Archives-Hash: ccbaff9cd4d0605b903d705a47a3de3f commit: e147d01855031095e123178d50e88d7ae1efcb34 Author: Magnus Granberg gentoo org> AuthorDate: Sat Apr 28 14:01:04 2012 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Sat Apr 28 14:01:04 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/zorry.git;a=3D= commit;h=3De147d018 fix config-root for --sync --- gobs/pym/sync.py | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gobs/pym/sync.py b/gobs/pym/sync.py index e992e9c..3fcf31d 100644 --- a/gobs/pym/sync.py +++ b/gobs/pym/sync.py @@ -5,8 +5,16 @@ import errno import logging import sys from git import * -from _emerge.actions import load_emerge_config, action_sync -from _emerge.main import parse_opts +from _emerge.main import emerge_main + +from gobs.readconf import get_conf_settings +reader=3Dget_conf_settings() +gobs_settings_dict=3Dreader.read_gobs_settings_all() +from gobs.ConnectionManager import connectionManager +CM=3DconnectionManager(gobs_settings_dict) +#selectively import the pgsql/mysql querys +if CM.getName()=3D=3D'pgsql': + from gobs.pgsql import * =20 def git_pull(): logging.info("Git pull") @@ -18,15 +26,18 @@ def git_pull(): logging.info("Git pull ... Done.") =20 def sync_tree(): - settings, trees, mtimedb =3D load_emerge_config() - portdb =3D trees[settings["ROOT"]]["porttree"].dbapi + conn=3DCM.getConnection() + config_id =3D get_default_config(conn) # HostConfigDir =3D table conf= igs id + CM.putConnection(conn) + default_config_root =3D "/var/lib/gobs/" + gobs_settings_dict['gobs_git= reponame'] + "/" + config_id[0] + "/" tmpcmdline =3D [] tmpcmdline.append("--sync") tmpcmdline.append("--quiet") - myaction, myopts, myfiles =3D parse_opts(tmpcmdline) + tmpcmdline.append("--config_root=3D" + default_config_root) + print("tmpcmdline: %s", default_config_root) logging.info("Emerge --sync") fail_sync =3D 0 - #fail_sync =3D action_sync(settings, trees, mtimedb, myopts, myaction) + #fail_sync =3D emerge_main(args=3Dtmpcmdline) if fail_sync is True: logging.warning("Emerge --sync fail!") else: