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 1Qgj5P-0005e7-40 for garchives@archives.gentoo.org; Tue, 12 Jul 2011 19:57:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 66D7221C0AA; Tue, 12 Jul 2011 19:57:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2810321C0AA for ; Tue, 12 Jul 2011 19:57:30 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8A7A72AC232 for ; Tue, 12 Jul 2011 19:57:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 9774680042 for ; Tue, 12 Jul 2011 19:57:29 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <021d8bc9211cb4f4adad814f6c1bbcd399f72786.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/api.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 021d8bc9211cb4f4adad814f6c1bbcd399f72786 Date: Tue, 12 Jul 2011 19:57:29 +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: X-Archives-Hash: 346b0219b39c70f86cdaa0c3873aedac commit: 021d8bc9211cb4f4adad814f6c1bbcd399f72786 Author: dol-sen gmail com> AuthorDate: Tue Jul 12 19:57:08 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Jul 12 19:57:08 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3D021d8bc9 fix success mistracking --- layman/api.py | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/layman/api.py b/layman/api.py index 8e54d7d..985eee0 100644 --- a/layman/api.py +++ b/layman/api.py @@ -114,14 +114,15 @@ class LaymanAPI(object): self._error("Repository '"+ovl+"' was not installed") results.append(False) continue + success =3D False try: self._get_installed_db().delete( self._get_installed_db().select(ovl)) - results.append(True) except Exception as e: self._error( - "Failed to disable repository '"+ovl+"':\n"+str(= e)) - results.append(False) + "Exception caught disabling repository '"+ovl+ + "':\n"+str(e)) + results.append(success) self.get_installed(dbreload=3DTrue) if False in results: return False @@ -147,12 +148,14 @@ class LaymanAPI(object): self._error(UnknownOverlayMessage(ovl)) results.append(False) continue + success =3D False try: - self._get_installed_db().add(self._get_remote_db().selec= t(ovl), quiet=3DTrue) - results.append(True) + success =3D self._get_installed_db().add( + self._get_remote_db().select(ovl), quiet=3DTrue) except Exception as e: - self._error("Failed to enable repository '"+ovl+"' : "+s= tr(e)) - results.append(False) + self._error("Exception caught enabling repository '"+ovl= + + "' : "+str(e)) + results.append(success) self.get_installed(dbreload=3DTrue) if False in results: return False