~ubuntu-branches/ubuntu/lucid/mercurial/lucid

« back to all changes in this revision

Viewing changes to debian/patches/deb_specific__optional-dependencies

  • Committer: Bazaar Package Importer
  • Author(s): Vernon Tang
  • Date: 2009-01-18 10:39:58 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090118103958-4ep2fqb5nl2pyc7y
Tags: 1.1.2-2
* debian/mercurial.postinst: symlink /usr/share/doc/mercurial if dpkg didn't
  do it when upgrading (closes: #512155)
* debian/control: mercurial-common replaces all earlier versions of
  mercurial

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Suggest Debian packages for some optional dependencies.
 
2
 
 
3
diff -r 06d10c5c850e hgext/bugzilla.py
 
4
--- a/hgext/bugzilla.py
 
5
+++ b/hgext/bugzilla.py
 
6
@@ -308,7 +308,8 @@
 
7
         global MySQLdb
 
8
         MySQLdb = mysql
 
9
     except ImportError, err:
 
10
-        raise util.Abort(_('python mysql support not available: %s') % err)
 
11
+        raise util.Abort(_('python mysql support not available: %s') % err +
 
12
+                         _(' (try installing the %s package)') % 'python-mysqldb')
 
13
 
 
14
     if node is None:
 
15
         raise util.Abort(_('hook type %s does not pass a changeset id') %
 
16
diff -r 06d10c5c850e hgext/convert/bzr.py
 
17
--- a/hgext/convert/bzr.py
 
18
+++ b/hgext/convert/bzr.py
 
19
@@ -31,7 +31,8 @@
 
20
             # access bzrlib stuff
 
21
             branch
 
22
         except NameError:
 
23
-            raise NoRepo('Bazaar modules could not be loaded')
 
24
+            raise NoRepo('Bazaar modules could not be loaded' +
 
25
+                         _(' (try installing the %s package)') % 'bzr')
 
26
 
 
27
         if not os.path.exists(os.path.join(path, '.bzr')):
 
28
             raise NoRepo('%s does not look like a Bazaar repo' % path)
 
29
diff -r 06d10c5c850e hgext/convert/common.py
 
30
--- a/hgext/convert/common.py
 
31
+++ b/hgext/convert/common.py
 
32
@@ -20,11 +20,12 @@
 
33
 
 
34
 class MissingTool(Exception): pass
 
35
 
 
36
-def checktool(exe, name=None, abort=True):
 
37
+def checktool(exe, name=None, abort=True, debname=None):
 
38
     name = name or exe
 
39
     if not util.find_exe(exe):
 
40
         exc = abort and util.Abort or MissingTool
 
41
-        raise exc(_('cannot find required "%s" tool') % name)
 
42
+        raise exc(_('cannot find required "%s" tool') % name +
 
43
+                  (debname and _(' (try installing the %s package)') % debname or ''))
 
44
 
 
45
 class NoRepo(Exception): pass
 
46
 
 
47
diff -r 06d10c5c850e hgext/convert/cvs.py
 
48
--- a/hgext/convert/cvs.py
 
49
+++ b/hgext/convert/cvs.py
 
50
@@ -16,7 +16,7 @@
 
51
         if not os.path.exists(cvs):
 
52
             raise NoRepo("%s does not look like a CVS checkout" % path)
 
53
 
 
54
-        checktool('cvs')
 
55
+        checktool('cvs', debname='cvs')
 
56
         self.cmd = ui.config('convert', 'cvsps', 'builtin')
 
57
         cvspsexe = self.cmd.split(None, 1)[0]
 
58
         self.builtin = cvspsexe == 'builtin'
 
59
diff -r 06d10c5c850e hgext/convert/darcs.py
 
60
--- a/hgext/convert/darcs.py
 
61
+++ b/hgext/convert/darcs.py
 
62
@@ -27,10 +27,11 @@
 
63
         if not os.path.exists(os.path.join(path, '_darcs')):
 
64
             raise NoRepo("%s does not look like a darcs repo" % path)
 
65
 
 
66
-        checktool('darcs')
 
67
+        checktool('darcs', debname='darcs')
 
68
 
 
69
         if ElementTree is None:
 
70
-            raise util.Abort(_("Python ElementTree module is not available"))
 
71
+            raise util.Abort(_("Python ElementTree module is not available") +
 
72
+                             _(" (try installing the %s package)") % 'python-celementtree')
 
73
 
 
74
         if not os.path.exists(os.path.join(path, '_darcs', 'inventory')):
 
75
             raise NoRepo("%s does not look like a darcs repo" % path)
 
76
diff -r 06d10c5c850e hgext/convert/git.py
 
77
--- a/hgext/convert/git.py
 
78
+++ b/hgext/convert/git.py
 
79
@@ -32,7 +32,7 @@
 
80
         if not os.path.exists(path + "/objects"):
 
81
             raise NoRepo("%s does not look like a Git repo" % path)
 
82
 
 
83
-        checktool('git', 'git')
 
84
+        checktool('git', 'git', debname='git-core')
 
85
 
 
86
         self.path = path
 
87
 
 
88
diff -r 06d10c5c850e hgext/convert/gnuarch.py
 
89
--- a/hgext/convert/gnuarch.py
 
90
+++ b/hgext/convert/gnuarch.py
 
91
@@ -33,7 +33,8 @@
 
92
             if util.find_exe('tla'):
 
93
                 self.execmd = 'tla'
 
94
             else:
 
95
-                raise util.Abort(_('cannot find a GNU Arch tool'))
 
96
+                raise util.Abort(_('cannot find a GNU Arch tool') +
 
97
+                                 _(' (try installing the %s package)') % 'tla')
 
98
 
 
99
         commandline.__init__(self, ui, self.execmd)
 
100
 
 
101
diff -r 06d10c5c850e hgext/convert/monotone.py
 
102
--- a/hgext/convert/monotone.py
 
103
+++ b/hgext/convert/monotone.py
 
104
@@ -43,7 +43,7 @@
 
105
         if not os.path.exists(path):
 
106
             raise norepo
 
107
 
 
108
-        checktool('mtn', abort=False)
 
109
+        checktool('mtn', abort=False, debname='monotone')
 
110
 
 
111
         # test if there are any revisions
 
112
         self.rev = None
 
113
diff -r 06d10c5c850e hgext/convert/subversion.py
 
114
--- a/hgext/convert/subversion.py
 
115
+++ b/hgext/convert/subversion.py
 
116
@@ -34,6 +34,7 @@
 
117
 
 
118
 from common import NoRepo, MissingTool, commit, encodeargs, decodeargs
 
119
 from common import commandline, converter_source, converter_sink, mapfile
 
120
+from common import checktool
 
121
 
 
122
 try:
 
123
     from svn.core import SubversionException, Pool
 
124
@@ -155,16 +156,19 @@
 
125
         try:
 
126
             SubversionException
 
127
         except NameError:
 
128
-            raise MissingTool(_('Subversion python bindings could not be loaded'))
 
129
+            raise MissingTool(_('Subversion python bindings could not be loaded') +
 
130
+                              _(' (try installing the %s package)') % 'python-subversion')
 
131
 
 
132
         try:
 
133
             version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
 
134
             if version < (1, 4):
 
135
                 raise MissingTool(_('Subversion python bindings %d.%d found, '
 
136
-                                    '1.4 or later required') % version)
 
137
+                                    '1.4 or later required') % version +
 
138
+                                  _(' (try upgrading the %s package)') % 'python-subversion')
 
139
         except AttributeError:
 
140
             raise MissingTool(_('Subversion python bindings are too old, 1.4 '
 
141
-                                'or later required'))
 
142
+                                'or later required') +
 
143
+                              _(' (try upgrading the %s package)') % 'python-subversion')
 
144
 
 
145
         self.encoding = locale.getpreferredencoding()
 
146
         self.lastrevs = {}
 
147
@@ -960,6 +964,9 @@
 
148
         return self.join('hg-authormap')
 
149
 
 
150
     def __init__(self, ui, path):
 
151
+        checktool('svn', debname='subversion')
 
152
+        checktool('svnadmin', debname='subversion')
 
153
+
 
154
         converter_sink.__init__(self, ui, path)
 
155
         commandline.__init__(self, ui, 'svn')
 
156
         self.delete = []
 
157
diff -r 06d10c5c850e mercurial/hgweb/server.py
 
158
--- a/mercurial/hgweb/server.py
 
159
+++ b/mercurial/hgweb/server.py
 
160
@@ -259,7 +259,8 @@
 
161
                     from OpenSSL import SSL
 
162
                     ctx = SSL.Context(SSL.SSLv23_METHOD)
 
163
                 except ImportError:
 
164
-                    raise util.Abort(_("SSL support is unavailable"))
 
165
+                    raise util.Abort(_("SSL support is unavailable") +
 
166
+                                     _(" (try installing the %s package)") % 'python-openssl')
 
167
                 ctx.use_privatekey_file(ssl_cert)
 
168
                 ctx.use_certificate_file(ssl_cert)
 
169
                 sock = socket.socket(self.address_family, self.socket_type)