Debian Codegraph @

debian/patches/deb_specific__optional-dependencies

raw
1 From: Python Applications Packaging Team
2 <[email protected]>
3 Date: Sun, 16 Aug 2020 11:03:07 +0200
4 Subject: deb_specific__optional-dependencies
5
6 Suggest Debian packages for some optional dependencies.
7 ---
8 hgext/bugzilla.py | 3 ++-
9 hgext/convert/bzr.py | 3 ++-
10 hgext/convert/common.py | 5 +++--
11 hgext/convert/cvs.py | 2 +-
12 hgext/convert/darcs.py | 2 +-
13 hgext/convert/git.py | 2 +-
14 hgext/convert/gnuarch.py | 3 ++-
15 hgext/convert/monotone.py | 2 +-
16 hgext/convert/subversion.py | 12 +++++++++---
17 mercurial/sslutil.py | 3 ++-
18 tests/test-https.t | 2 +-
19 11 files changed, 25 insertions(+), 14 deletions(-)
20
21 --- a/hgext/bugzilla.py
22 +++ b/hgext/bugzilla.py
23 @@ -504,7 +504,8 @@ class bzmysql(bzaccess):
24 bzmysql._MySQLdb = mysql
25 except ImportError as err:
26 raise error.Abort(
27 - _(b'python mysql support not available: %s') % err
28 + _(b'python mysql support not available: %s') % err +
29 + _(b' (try installing the %s package)') % b'python3-mysqldb'
30 )
31
32 bzaccess.__init__(self, ui)
33 --- a/hgext/convert/bzr.py
34 +++ b/hgext/convert/bzr.py
35 @@ -73,7 +73,8 @@ class bzr_source(common.converter_source
36 # access breezy stuff
37 bzrdir
38 except NameError:
39 - raise common.NoRepo(_(b'Bazaar modules could not be loaded'))
40 + raise common.NoRepo(_(b'Bazaar modules could not be loaded') +
41 + _(b' (try installing the %s package)') % b'bzr')
42
43 path = util.abspath(path)
44 self._checkrepotype(path)
45 --- a/hgext/convert/common.py
46 +++ b/hgext/convert/common.py
47 @@ -126,7 +126,7 @@ class MissingTool(Exception):
48
49
50 def checktool(
51 - exe: bytes, name: bytes | None = None, abort: bool = True
52 + exe: bytes, name: bytes | None = None, abort: bool = True, debname: bytes | None = None
53 ) -> None:
54 name = name or exe
55 if not procutil.findexe(exe):
56 @@ -134,7 +134,8 @@ def checktool(
57 exc = error.Abort
58 else:
59 exc = MissingTool
60 - raise exc(_(b'cannot find required "%s" tool') % name)
61 + raise exc(_(b'cannot find required "%s" tool') % name +
62 + (debname and _(b' (try installing the %s package)') % debname or b''))
63
64
65 class NoRepo(Exception):
66 --- a/hgext/convert/cvs.py
67 +++ b/hgext/convert/cvs.py
68 @@ -44,7 +44,7 @@ class convert_cvs(converter_source):
69 if not os.path.exists(cvs):
70 raise NoRepo(_(b"%s does not look like a CVS checkout") % path)
71
72 - checktool(b'cvs')
73 + checktool(b'cvs', debname=b'cvs')
74
75 self.changeset = None
76 self.files = {}
77 --- a/hgext/convert/darcs.py
78 +++ b/hgext/convert/darcs.py
79 @@ -37,7 +37,7 @@ class darcs_source(common.converter_sour
80 if not os.path.exists(os.path.join(path, b'_darcs')):
81 raise NoRepo(_(b"%s does not look like a darcs repository") % path)
82
83 - common.checktool(b'darcs')
84 + common.checktool(b'darcs', debname=b'darcs')
85 version = self.run0(b'--version').splitlines()[0].strip()
86 if version < b'2.1':
87 raise error.Abort(
88 --- a/hgext/convert/git.py
89 +++ b/hgext/convert/git.py
90 @@ -102,7 +102,7 @@ class convert_git(common.converter_sourc
91 else:
92 self.simopt = []
93
94 - common.checktool(b'git', b'git')
95 + common.checktool(b'git', b'git', debname=b'git')
96
97 self.path = path
98 self.submodules = []
99 --- a/hgext/convert/gnuarch.py
100 +++ b/hgext/convert/gnuarch.py
101 @@ -58,7 +58,8 @@ class gnuarch_source(common.converter_so
102 if procutil.findexe(b'tla'):
103 self.execmd = b'tla'
104 else:
105 - raise error.Abort(_(b'cannot find a GNU Arch tool'))
106 + raise error.Abort(_(b'cannot find a GNU Arch tool') +
107 + _(b' (try installing the %s package)') % b'tla')
108
109 common.commandline.__init__(self, ui, self.execmd)
110
111 --- a/hgext/convert/monotone.py
112 +++ b/hgext/convert/monotone.py
113 @@ -86,7 +86,7 @@ class monotone_source(common.converter_s
114 self.files = None
115 self.dirs = None
116
117 - common.checktool(b'mtn', abort=False)
118 + common.checktool(b'mtn', abort=False, debname=b'monotone')
119
120 def mtnrun(self, *args, **kwargs):
121 if self.automatestdio:
122 --- a/hgext/convert/subversion.py
123 +++ b/hgext/convert/subversion.py
124 @@ -478,7 +478,8 @@ class svn_source(converter_source):
125 _(b"%s does not look like a Subversion repository") % url
126 )
127 if svn is None:
128 - raise MissingTool(_(b'could not load Subversion python bindings'))
129 + raise MissingTool(_(b'could not load Subversion python bindings') +
130 + _(b' (try installing the %s package)') % b'python3-subversion')
131
132 try:
133 version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
134 @@ -488,14 +489,16 @@ class svn_source(converter_source):
135 b'Subversion python bindings %d.%d found, '
136 b'1.4 or later required'
137 )
138 - % version
139 + % version +
140 + _(b' (try upgrading the %s package)') % b'python-subversion'
141 )
142 except AttributeError:
143 raise MissingTool(
144 _(
145 b'Subversion python bindings are too old, 1.4 '
146 b'or later required'
147 - )
148 + ) +
149 + _(b' (try upgrading the %s package)') % b'python-subversion'
150 )
151
152 self.lastrevs = {}
153 @@ -1426,6 +1429,9 @@ class svn_sink(converter_sink, commandli
154 return self.join(b'hg-authormap')
155
156 def __init__(self, ui, repotype, path):
157 + common.checktool(b'svn', debname=b'subversion')
158 + common.checktool(b'svnadmin', debname=b'subversion')
159 +
160 converter_sink.__init__(self, ui, repotype, path)
161 commandline.__init__(self, ui, b'svn')
162 self.delete = []
163 --- a/mercurial/sslutil.py
164 +++ b/mercurial/sslutil.py
165 @@ -210,7 +210,8 @@ def _hostsettings(ui, hostname):
166 cafile = util.expandpath(cafile)
167 if not os.path.exists(cafile):
168 raise error.Abort(
169 - _(b'could not find web.cacerts: %s') % cafile
170 + _(b'could not find web.cacerts: %s') % cafile +
171 + _(b' (try installing the %s package)') % b'ca-certificates'
172 )
173 elif s[b'allowloaddefaultcerts']:
174 # CAs not defined in config. Try to find system bundles.
175 --- a/tests/test-https.t
176 +++ b/tests/test-https.t
177 @@ -34,7 +34,7 @@ Make server certificates:
178 cacert not found
179
180 $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/
181 - abort: could not find web.cacerts: no-such.pem
182 + abort: could not find web.cacerts: no-such.pem (try installing the ca-certificates package)
183 [255]
184
185 Test server address cannot be reused