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 1QF2TQ-0003Vl-CB for garchives@archives.gentoo.org; Wed, 27 Apr 2011 11:00:00 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8C2691C09D; Wed, 27 Apr 2011 10:58:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4CB551C09D for ; Wed, 27 Apr 2011 10:58:43 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AC2301B406A for ; Wed, 27 Apr 2011 10:58:42 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id C323980507 for ; Wed, 27 Apr 2011 10:58:41 +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: <091147c6abb9bdfa814a8fc571b6cad85669fa46.dol-sen@gentoo> Subject: [gentoo-commits] proj/layman:master commit in: layman/ X-VCS-Repository: proj/layman X-VCS-Files: layman/db.py X-VCS-Directories: layman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 091147c6abb9bdfa814a8fc571b6cad85669fa46 Date: Wed, 27 Apr 2011 10:58:41 +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: 04460ad644d660aa81ace310859ba5ae commit: 091147c6abb9bdfa814a8fc571b6cad85669fa46 Author: Brian Dolbec gmail com> AuthorDate: Thu Feb 24 06:13:04 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Mar 27 02:39:00 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3D091147c6 remove a few raise Exception()'s and replace them with self.output.error = messages. wrap the make_Conf in a config check. --- layman/db.py | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-) diff --git a/layman/db.py b/layman/db.py index 01dc454..ed2bb2e 100644 --- a/layman/db.py +++ b/layman/db.py @@ -56,10 +56,10 @@ class DB(DbBase): quiet =3D int(config['quietness']) < 3 =20 DbBase.__init__(self, - [config['local_list'], ], config, - ignore, - quiet) + paths=3D[config['local_list'], ], + ignore=3Dignore, + quiet=3Dquiet) =20 self.output.debug('DB handler initiated', 6) =20 @@ -119,22 +119,30 @@ class DB(DbBase): overlay.set_priority(self.config['priority']) self.overlays[overlay.name] =3D overlay self.write(self.path) - make_conf =3D MakeConf(self.config, self.overlays) - make_conf.add(overlay) + if self.config['make_config']: + make_conf =3D MakeConf(self.config, self.overlays) + make_ok =3D make_conf.add(overlay) + return make_ok + return True else: mdir =3D path([self.config['storage'], overlay.name]) delete_empty_directory(mdir, self.output) if os.path.exists(mdir): - raise Exception('Adding overlay "%s" failed!' + self.output.error('Adding repository "%s" failed!' ' Possible remains of the operation have= NOT' ' been removed and may be left at "%s".' ' Please remove them manually if require= d.' \ % (overlay.name, mdir)) + return False else: - raise Exception('Adding overlay "%s" failed!' % over= lay.name) + self.output.error( + 'Adding repository "%s" failed!' % overlay.name) + return False else: - raise Exception('Overlay "' + overlay.name + '" already in t= he loca' - 'l list!') + self.output.error('Repository "' + overlay.name + + '" already in the local (installed) list!') + return False + =20 def delete(self, overlay): ''' @@ -243,7 +251,8 @@ class RemoteDB(DbBase): =20 quiet =3D int(config['quietness']) < 3 =20 - DbBase.__init__(self, paths, config, ignore, quiet, ignore_init_= read_errors) + DbBase.__init__(self, config, paths=3Dpaths, ignore=3Dignore, + quiet=3Dquiet, ignore_init_read_errors=3Dignore_init_read_er= rors) =20 # overrider def _broken_catalog_hint(self):