Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/layman:master commit in: layman/overlays/, layman/
Date: Fri, 24 Apr 2020 20:59:24
Message-Id: 1587736572.ae11c78123120e8c0a399e806dad224504aad574.dolsen@gentoo
1 commit: ae11c78123120e8c0a399e806dad224504aad574
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 24 12:35:38 2020 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 24 13:56:12 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/layman.git/commit/?id=ae11c781
7
8 Add additional debug statements to trace a py3.7, py3.8 error
9
10 Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>
11
12 layman/db.py | 1 +
13 layman/overlays/overlay.py | 19 ++++++++++++++-----
14 layman/remotedb.py | 5 ++++-
15 3 files changed, 19 insertions(+), 6 deletions(-)
16
17 diff --git a/layman/db.py b/layman/db.py
18 index d67ea87..9b32952 100644
19 --- a/layman/db.py
20 +++ b/layman/db.py
21 @@ -111,6 +111,7 @@ class DB(DbBase):
22 if overlay.name not in self.overlays.keys():
23 if not self._check_official(overlay):
24 return False
25 + self.output.debug('RemoteDB.__init__(), DB.add overlay.add() call', 4)
26 result = overlay.add(self.config['storage'])
27 if result == 0:
28 if 'priority' in self.config.keys():
29
30 diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py
31 index 9cbeb99..03829a8 100755
32 --- a/layman/overlays/overlay.py
33 +++ b/layman/overlays/overlay.py
34 @@ -95,8 +95,9 @@ class Overlay(object):
35 def add(self, base):
36 res = 1
37 first_s = True
38 -
39 + self.output.debug('Overlay.add()', 5)
40 self.sources = self.filter_protocols(self.sources)
41 + self.output.debug('Overlay.add(), filtered protocols, sources:' + str(self.sources), 5)
42 if not self.sources:
43 msg = 'Overlay.add() error: overlay "%(name)s" does not support '\
44 ' the given\nprotocol(s) %(protocol)s and cannot be '\
45 @@ -110,10 +111,12 @@ class Overlay(object):
46 if not first_s:
47 self.output.info('\nTrying next source of listed sources...', 4)
48 try:
49 + self.output.debug('Overlay.add(), s.add(base)', 5)
50 res = s.add(base)
51 if res == 0:
52 # Worked, throw other sources away
53 self.sources = [s]
54 + self.output.debug('Overlay.add(), back from s.add(base)', 5)
55 break
56 except Exception as error:
57 self.output.warn(str(error), 4)
58 @@ -132,11 +135,17 @@ class Overlay(object):
59 from the overlay's sources.
60 '''
61 _sources = []
62 - if not self.config['protocol_filter']:
63 + self.output.debug('Overlay.filter_protocols()', 5)
64 + self.output.debug('Overlay.filter_protocols() filters:' + str(type(self.config['protocol_filter'])), 5)
65 + if not self.config['protocol_filter'] and not self.config['protocol_filter'] == []:
66 + self.output.debug('Overlay.filter_protocols() no protocol_filter, returning', 5)
67 return sources
68 -
69 + self.output.debug('Overlay.filter_protocols() sources:' + str(sources), 5)
70 for source in sources:
71 + self.output.debug('Overlay.filter_protocols() source:' + str(type(source)), 5)
72 + self.output.debug('Overlay.filter_protocols() filters:' + str(self.config['protocol_filter']), 5)
73 for protocol in self.config['protocol_filter']:
74 + self.output.debug('Overlay.filter_protocols() protocol: ' + protocol + ' ' + str(type(protocol)), 5)
75 protocol = protocol.lower()
76 #re.search considers "\+" as the literal "+".
77 if protocol == 'git+ssh':
78 @@ -144,7 +153,7 @@ class Overlay(object):
79 protocol += '://'
80 if re.search('^' + protocol, source.src):
81 _sources.append(source)
82 -
83 + self.output.debug('Overlay.filter_protocols(), returning sources' + str(_sources), 5)
84 return _sources
85
86
87 @@ -792,7 +801,7 @@ class Overlay(object):
88 try:
89 res = self.sources[0].update(base, src)
90 if res == 0:
91 - # Updating it worked, no need to bother
92 + # Updating it worked, no need to bother
93 # checking other sources.
94 self.sources[0].src = src
95 result = True
96
97 diff --git a/layman/remotedb.py b/layman/remotedb.py
98 index 2df0c63..6e75bec 100644
99 --- a/layman/remotedb.py
100 +++ b/layman/remotedb.py
101 @@ -83,15 +83,18 @@ class RemoteDB(DbBase):
102 self.output.debug('RemoteDB.__init__(), paths to load = %s' %str(paths),
103 2)
104 if config['nocheck']:
105 + self.output.debug('RemoteDB.__init__(), ignore = 2', 5)
106 ignore = 2
107 else:
108 + self.output.debug('RemoteDB.__init__(), ignore = 0', 5)
109 ignore = 0
110
111 #quiet = int(config['quietness']) < 3
112 -
113 + self.output.debug('RemoteDB.__init__(), DbBase.__init__() call', 5)
114 DbBase.__init__(self, config, paths=paths, ignore=ignore,
115 ignore_init_read_errors=ignore_init_read_errors)
116
117 + self.output.debug('RemoteDB.__init__(), back from DbBase.__init__() call', 5)
118 self.gpg = None
119 self.gpg_config = None