Gentoo Archives: gentoo-commits

From: Devan Franchini <twitch153@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/layman:master commit in: layman/
Date: Thu, 02 Feb 2017 01:12:55
Message-Id: 1485997863.d9112d003d5d9bcc71d681206522cc161f59f169.twitch153@gentoo
1 commit: d9112d003d5d9bcc71d681206522cc161f59f169
2 Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 2 01:11:01 2017 +0000
4 Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 2 01:11:03 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/layman.git/commit/?id=d9112d00
7
8 api.py: Moves instantiation of rdb to above for-loop
9
10 There is no need to repeatedly connect to the rdb when syncing
11 overlays. We are better off connecting once and querying it whenever
12 we need to. Doing it every time leads us to issues like bug #603296
13
14 X-Gentoo-Bug: 603296
15 X-Gentoo-Bug-URL: https://bugs.gentoo.org/603296
16
17 layman/api.py | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20 diff --git a/layman/api.py b/layman/api.py
21 index 2c46bb7..73fb72a 100755
22 --- a/layman/api.py
23 +++ b/layman/api.py
24 @@ -384,6 +384,7 @@ class LaymanAPI(object):
25 success = []
26 repos = self._check_repo_type(repos, "sync")
27 db = self._get_installed_db()
28 + rdb = self._get_remote_db()
29
30 self.output.debug("API.sync(); starting ovl loop", 5)
31 for ovl in repos:
32 @@ -406,7 +407,7 @@ class LaymanAPI(object):
33
34 try:
35 self.output.debug("API.sync(); try: self._get_remote_db().select(ovl)", 5)
36 - ordb = self._get_remote_db().select(ovl)
37 + ordb = rdb.select(ovl)
38 except UnknownOverlayException:
39 message = 'Overlay "%(repo)s" could not be found in the remote '\
40 'lists.\nPlease check if it has been renamed and '\