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 1Qup0p-0000jj-9N for garchives@archives.gentoo.org; Sat, 20 Aug 2011 17:07:11 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 074BB21C09B; Sat, 20 Aug 2011 17:06:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B48A521C093 for ; Sat, 20 Aug 2011 17:06:53 +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 020551B404F for ; Sat, 20 Aug 2011 17:06:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id DEDBD8004B for ; Sat, 20 Aug 2011 17:06:51 +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: f1ac6fc5b697632d4db04265bc0c0ec6554e6855 Date: Sat, 20 Aug 2011 17:06:51 +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: eb8e6451214b12f876208c5e026e7139 commit: f1ac6fc5b697632d4db04265bc0c0ec6554e6855 Author: dol-sen gmail com> AuthorDate: Sat Aug 20 01:08:43 2011 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Aug 20 01:08:43 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/layman.git;a=3D= commit;h=3Df1ac6fc5 fix success reporting identified in bug 379779. Improve and change error= output from info(), warn() to error(). --- layman/api.py | 4 ++-- layman/db.py | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/layman/api.py b/layman/api.py index cfd9a68..7894c56 100755 --- a/layman/api.py +++ b/layman/api.py @@ -441,7 +441,7 @@ class LaymanAPI(object): """ =20 try: - dbreload =3D self._get_remote_db().cache() + dbreload, succeeded =3D self._get_remote_db().cache() self.output.debug( 'LaymanAPI.fetch_remote_list(); cache updated =3D %s' % str(dbreload),8) @@ -450,7 +450,7 @@ class LaymanAPI(object): + str(error)) return False self.get_available(dbreload) - return True + return succeeded =20 =20 def get_available(self, dbreload=3DFalse): diff --git a/layman/db.py b/layman/db.py index bd58cd6..08af0f6 100644 --- a/layman/db.py +++ b/layman/db.py @@ -288,7 +288,7 @@ class RemoteDB(DbBase): >>> config.set_option('quietness', 3) >>> a =3D RemoteDB(config) >>> a.cache() - True + (True, True) >>> b =3D open(a.filepath(config['overlays'])+'.xml') >>> b.readlines()[24] ' A collection of ebuilds from Gunnar Wrobel [wrobel@gentoo= .org].\\n' @@ -300,6 +300,8 @@ class RemoteDB(DbBase): [u'wrobel', u'wrobel-stable'] ''' has_updates =3D False + # succeeded reset when a failure is detected + succeeded =3D True for url in self.urls: =20 filepath =3D self.filepath(url) @@ -334,12 +336,17 @@ class RemoteDB(DbBase): % url, 4) self.output.info('Last-modified: %s' % timestamp, 4) else: - self.output.info('RemoteDB.cache(); HTTPError was:\n= %s' - % str(e)) + self.output.error('RemoteDB.cache(); HTTPError was:\= n' + 'url: %s\n%s' + % (url, str(e))) + succeeded =3D False continue except IOError, error: - self.output.warn('RemoteDB.cache(); Failed to update the= overlay list from: ' - + url + '\nIOError was:\n' + str(error)) + self.output.error('RemoteDB.cache(); Failed to update th= e ' + 'overlay list from: %s\nIOError was:%s\n' + % (url, str(error))) + succeeded =3D False + continue else: if url.startswith('file://'): quieter =3D 1 @@ -387,7 +394,9 @@ class RemoteDB(DbBase): except Exception, error: raise IOError('Failed to temporarily cache overlays = list in' ' ' + mpath + '\nError was:\n' + str(e= rror)) - return has_updates + self.output.debug("RemoteDB.cache() returning: has_updates, suc= ceeded" + " %s, %s" % (str(has_updates), str(succeeded)), 4) + return has_updates, succeeded =20 =20 def filepath(self, url):