File: deb_specific__optional-dependencies

package info (click to toggle)
mercurial 7.0~rc1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 43,656 kB
  • sloc: python: 205,747; ansic: 45,243; tcl: 3,715; sh: 1,797; lisp: 1,483; cpp: 864; makefile: 752; javascript: 649; xml: 36
file content (185 lines) | stat: -rw-r--r-- 7,163 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
From: Python Applications Packaging Team
 <python-apps-team@lists.alioth.debian.org>
Date: Sun, 16 Aug 2020 11:03:07 +0200
Subject: deb_specific__optional-dependencies

Suggest Debian packages for some optional dependencies.
---
 hgext/bugzilla.py           |    3 ++-
 hgext/convert/bzr.py        |    3 ++-
 hgext/convert/common.py     |    5 +++--
 hgext/convert/cvs.py        |    2 +-
 hgext/convert/darcs.py      |    2 +-
 hgext/convert/git.py        |    2 +-
 hgext/convert/gnuarch.py    |    3 ++-
 hgext/convert/monotone.py   |    2 +-
 hgext/convert/subversion.py |   12 +++++++++---
 mercurial/sslutil.py        |    3 ++-
 tests/test-https.t          |    2 +-
 11 files changed, 25 insertions(+), 14 deletions(-)

--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -504,7 +504,8 @@ class bzmysql(bzaccess):
             bzmysql._MySQLdb = mysql
         except ImportError as err:
             raise error.Abort(
-                _(b'python mysql support not available: %s') % err
+                _(b'python mysql support not available: %s') % err +
+                _(b' (try installing the %s package)') % b'python3-mysqldb'
             )
 
         bzaccess.__init__(self, ui)
--- a/hgext/convert/bzr.py
+++ b/hgext/convert/bzr.py
@@ -73,7 +73,8 @@ class bzr_source(common.converter_source
             # access breezy stuff
             bzrdir
         except NameError:
-            raise common.NoRepo(_(b'Bazaar modules could not be loaded'))
+            raise common.NoRepo(_(b'Bazaar modules could not be loaded') +
+                                _(b' (try installing the %s package)') % b'bzr')
 
         path = util.abspath(path)
         self._checkrepotype(path)
--- a/hgext/convert/common.py
+++ b/hgext/convert/common.py
@@ -127,7 +127,7 @@ class MissingTool(Exception):
 
 
 def checktool(
-    exe: bytes, name: Optional[bytes] = None, abort: bool = True
+    exe: bytes, name: Optional[bytes] = None, abort: bool = True, debname: Optional[bytes] = None
 ) -> None:
     name = name or exe
     if not procutil.findexe(exe):
@@ -135,7 +135,8 @@ def checktool(
             exc = error.Abort
         else:
             exc = MissingTool
-        raise exc(_(b'cannot find required "%s" tool') % name)
+        raise exc(_(b'cannot find required "%s" tool') % name +
+                  (debname and _(b' (try installing the %s package)') % debname or b''))
 
 
 class NoRepo(Exception):
--- a/hgext/convert/cvs.py
+++ b/hgext/convert/cvs.py
@@ -44,7 +44,7 @@ class convert_cvs(converter_source):
         if not os.path.exists(cvs):
             raise NoRepo(_(b"%s does not look like a CVS checkout") % path)
 
-        checktool(b'cvs')
+        checktool(b'cvs', debname=b'cvs')
 
         self.changeset = None
         self.files = {}
--- a/hgext/convert/darcs.py
+++ b/hgext/convert/darcs.py
@@ -37,7 +37,7 @@ class darcs_source(common.converter_sour
         if not os.path.exists(os.path.join(path, b'_darcs')):
             raise NoRepo(_(b"%s does not look like a darcs repository") % path)
 
-        common.checktool(b'darcs')
+        common.checktool(b'darcs', debname=b'darcs')
         version = self.run0(b'--version').splitlines()[0].strip()
         if version < b'2.1':
             raise error.Abort(
--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -102,7 +102,7 @@ class convert_git(common.converter_sourc
         else:
             self.simopt = []
 
-        common.checktool(b'git', b'git')
+        common.checktool(b'git', b'git', debname=b'git')
 
         self.path = path
         self.submodules = []
--- a/hgext/convert/gnuarch.py
+++ b/hgext/convert/gnuarch.py
@@ -58,7 +58,8 @@ class gnuarch_source(common.converter_so
             if procutil.findexe(b'tla'):
                 self.execmd = b'tla'
             else:
-                raise error.Abort(_(b'cannot find a GNU Arch tool'))
+                raise error.Abort(_(b'cannot find a GNU Arch tool') +
+                                  _(b' (try installing the %s package)') % b'tla')
 
         common.commandline.__init__(self, ui, self.execmd)
 
--- a/hgext/convert/monotone.py
+++ b/hgext/convert/monotone.py
@@ -89,7 +89,7 @@ class monotone_source(common.converter_s
         self.files = None
         self.dirs = None
 
-        common.checktool(b'mtn', abort=False)
+        common.checktool(b'mtn', abort=False, debname=b'monotone')
 
     def mtnrun(self, *args, **kwargs):
         if self.automatestdio:
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -478,7 +478,8 @@ class svn_source(converter_source):
                 _(b"%s does not look like a Subversion repository") % url
             )
         if svn is None:
-            raise MissingTool(_(b'could not load Subversion python bindings'))
+            raise MissingTool(_(b'could not load Subversion python bindings') +
+                              _(b' (try installing the %s package)') % b'python3-subversion')
 
         try:
             version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
@@ -488,14 +489,16 @@ class svn_source(converter_source):
                         b'Subversion python bindings %d.%d found, '
                         b'1.4 or later required'
                     )
-                    % version
+                    % version +
+                    _(b' (try upgrading the %s package)') % b'python-subversion'
                 )
         except AttributeError:
             raise MissingTool(
                 _(
                     b'Subversion python bindings are too old, 1.4 '
                     b'or later required'
-                )
+                ) +
+                _(b' (try upgrading the %s package)') % b'python-subversion'
             )
 
         self.lastrevs = {}
@@ -1426,6 +1429,9 @@ class svn_sink(converter_sink, commandli
         return self.join(b'hg-authormap')
 
     def __init__(self, ui, repotype, path):
+        common.checktool(b'svn', debname=b'subversion')
+        common.checktool(b'svnadmin', debname=b'subversion')
+
         converter_sink.__init__(self, ui, repotype, path)
         commandline.__init__(self, ui, b'svn')
         self.delete = []
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -210,7 +210,8 @@ def _hostsettings(ui, hostname):
                 cafile = util.expandpath(cafile)
                 if not os.path.exists(cafile):
                     raise error.Abort(
-                        _(b'could not find web.cacerts: %s') % cafile
+                        _(b'could not find web.cacerts: %s') % cafile +
+                        _(b' (try installing the %s package)') % b'ca-certificates'
                     )
             elif s[b'allowloaddefaultcerts']:
                 # CAs not defined in config. Try to find system bundles.
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -34,7 +34,7 @@ Make server certificates:
 cacert not found
 
   $ hg in --config web.cacerts=no-such.pem https://localhost:$HGPORT/
-  abort: could not find web.cacerts: no-such.pem
+  abort: could not find web.cacerts: no-such.pem (try installing the ca-certificates package)
   [255]
 
 Test server address cannot be reused