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-0005e8-6Y 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 6066221C09E; 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 2267921C09E 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 67B402AC229 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 42CB18003D 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: Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/api.py layman/db.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: c5c3121331d8f2f2b39b8f41b91d705d197be250 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: 6a26e5108d4b506fa1ad8b720e66b2b4 commit: c5c3121331d8f2f2b39b8f41b91d705d197be250 Author: dol-sen gmail com> AuthorDate: Tue Jul 12 19:01:43 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Jul 12 19:36:52 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3Dc5c31213 fix mistracking success adding an overlay. --- layman/api.py | 17 +++++++++-------- layman/db.py | 4 +++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/layman/api.py b/layman/api.py index 8e54d7d..a924ead 100644 --- a/layman/api.py +++ b/layman/api.py @@ -114,14 +114,14 @@ class LaymanAPI(object): self._error("Repository '"+ovl+"' was not installed") results.append(False) continue + success =3D False try: - self._get_installed_db().delete( + success =3D 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 +147,13 @@ 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 diff --git a/layman/db.py b/layman/db.py index 3ed5cc6..b1df906 100644 --- a/layman/db.py +++ b/layman/db.py @@ -206,7 +206,9 @@ class DB(DbBase): self.write(self.path) make_conf.delete(overlay) else: - raise Exception('No local overlay named "' + overlay.name + = '"!') + self.output.error('No local overlay named "' + overlay.name = + '"!') + return False + return True =20 def sync(self, overlay_name, quiet =3D False): '''Synchronize the given overlay.'''