From: Python Applications Packaging Team Date: Sun, 16 Aug 2020 09:03:07 +0000 (+0200) Subject: deb_specific__optional-dependencies X-Git-Tag: archive/raspbian/6.5.3-1+rpi1^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1aef0963f931e3fb6208bb824ceba67f5148fb0b;p=mercurial.git deb_specific__optional-dependencies Suggest Debian packages for some optional dependencies. Gbp-Pq: Name deb_specific__optional-dependencies --- diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py index ff9979a..16a3549 100644 --- a/hgext/bugzilla.py +++ b/hgext/bugzilla.py @@ -503,7 +503,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) diff --git a/hgext/convert/bzr.py b/hgext/convert/bzr.py index e075b46..d98302d 100644 --- a/hgext/convert/bzr.py +++ b/hgext/convert/bzr.py @@ -71,7 +71,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) diff --git a/hgext/convert/common.py b/hgext/convert/common.py index 9505ead..fc60581 100644 --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -89,14 +89,15 @@ class MissingTool(Exception): pass -def checktool(exe, name=None, abort=True): +def checktool(exe, name=None, abort=True, debname=None): name = name or exe if not procutil.findexe(exe): if abort: 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): diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py index 5593ccf..7df7ef3 100644 --- a/hgext/convert/cvs.py +++ b/hgext/convert/cvs.py @@ -46,7 +46,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 = {} diff --git a/hgext/convert/darcs.py b/hgext/convert/darcs.py index 7055884..fcbec98 100644 --- a/hgext/convert/darcs.py +++ b/hgext/convert/darcs.py @@ -35,7 +35,7 @@ class darcs_source(common.converter_source, common.commandline): 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( diff --git a/hgext/convert/git.py b/hgext/convert/git.py index 2a9ca4c..1f57182 100644 --- a/hgext/convert/git.py +++ b/hgext/convert/git.py @@ -100,7 +100,7 @@ class convert_git(common.converter_source, common.commandline): else: self.simopt = [] - common.checktool(b'git', b'git') + common.checktool(b'git', b'git', debname=b'git') self.path = path self.submodules = [] diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py index b845b26..06a7d75 100644 --- a/hgext/convert/gnuarch.py +++ b/hgext/convert/gnuarch.py @@ -56,7 +56,8 @@ class gnuarch_source(common.converter_source, common.commandline): 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) diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py index 91e698d..74ab270 100644 --- a/hgext/convert/monotone.py +++ b/hgext/convert/monotone.py @@ -86,7 +86,7 @@ class monotone_source(common.converter_source, common.commandline): 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: diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py index 4885c8a..1c9a5a3 100644 --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -477,7 +477,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 @@ -487,14 +488,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 = {} @@ -1425,6 +1428,8 @@ class svn_sink(converter_sink, commandline): 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') diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py index 03d3d6b..9d7f162 100644 --- a/mercurial/sslutil.py +++ b/mercurial/sslutil.py @@ -207,7 +207,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. diff --git a/tests/test-https.t b/tests/test-https.t index 12ef1cb..5f66a34 100644 --- 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