From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0D25D13877A for ; Tue, 19 Aug 2014 05:26:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CD3DCE0866; Tue, 19 Aug 2014 05:26:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 59103E0866 for ; Tue, 19 Aug 2014 05:26:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3322E33FF3A for ; Tue, 19 Aug 2014 05:26:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 918033B8E for ; Tue, 19 Aug 2014 01:49:05 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1408211929.754cc935e1484b580e1bcbabb4210ffc4084efc6.twitch153@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: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: 754cc935e1484b580e1bcbabb4210ffc4084efc6 X-VCS-Branch: master Date: Tue, 19 Aug 2014 01:49:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 91ad2fd5-0f69-4d03-be31-4ec151dbf039 X-Archives-Hash: c61d3461fc3916d6ddea329f3410a618 commit: 754cc935e1484b580e1bcbabb4210ffc4084efc6 Author: Brian Dolbec gentoo org> AuthorDate: Sat Jul 26 23:38:14 2014 +0000 Commit: Devan Franchini gentoo org> CommitDate: Sat Aug 16 17:58:49 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=754cc935 Fix errors in overlay updates. Original problem reported in #gentoo-overlays by user quinso. --- layman/api.py | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/layman/api.py b/layman/api.py index bb63d8d..cff89ed 100755 --- a/layman/api.py +++ b/layman/api.py @@ -409,9 +409,8 @@ class LaymanAPI(object): current_src = odb.sources[0].src (available_srcs, valid) = verify_overlay_src(current_src, set(e.src for e in ordb.sources)) - + if ordb and odb and not valid: - update_url = True if len(available_srcs) == 1: plural = '' candidates = ' %s' % tuple(available_srcs)[0] @@ -437,8 +436,8 @@ class LaymanAPI(object): 'candidates':candidates, 'plural':plural, }) - return True, msg - return False, '' + return True, msg, available_srcs + return False, '', available_srcs def sync(self, repos, output_results=True, update_news=False): """syncs the specified repo(s) specified by repos @@ -486,22 +485,29 @@ class LaymanAPI(object): self.output.debug("API.sync(); else: self._get_remote_db().select(ovl)", 5) (diff_type, type_msg) = self._verify_overlay_type(odb, ordb) - (update_url, url_msg) = self._verify_overlay_source(odb, ordb) + (update_url, url_msg, available_srcs) = self._verify_overlay_source(odb, ordb) + + try: + if diff_type: + self.output.debug("API.sync(); starting API.readd_repos(ovl)", 5) + warnings.append((ovl, type_msg)) + self.readd_repos(ovl) + success.append((ovl, 'Successfully readded overlay "' + ovl + '".')) + else: + if update_url: + self.output.debug("API.sync() starting db.update(ovl)", 5) + warnings.append((ovl, url_msg)) + update_success = db.update(ordb, available_srcs) + if not update_success: + self.output.warn('Failed to update repo...readding', 2) + self.readd_repos(ovl) + except Exception as error: + self.output.warn('Failed to perform overlay type or url updates', 2) + self.output.warn(' for Overlay: %s' % ovl, 2) + self.output.warn(' Error was: %s' % str(error)) + continue try: - if diff_type: - self.output.debug("API.sync(); starting API.readd_repos(ovl)", 5) - warnings.append((ovl, type_msg)) - self.readd_repos(ovl) - success.append((ovl, 'Successfully readded overlay "' + ovl + '".')) - else: - if update_url: - self.output.debug("API.sync() starting db.update(ovl)", 5) - warnings.append((ovl, url_msg)) - update_success = db.update(ordb, available_srcs) - if not update_success: - self.output.warn('Failed to update repo...readding', 2) - self.readd_repos(ovl) self.output.debug("API.sync(); starting db.sync(ovl)", 5) db.sync(ovl) success.append((ovl,'Successfully synchronized overlay "' + ovl + '".'))