Package: mercurial / 4.9-2

deb_specific__fix_fhs_paths.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Use FHS compliant path for data
 By default, mercurial installs expects its data files next to their
 py files in /usr/lib/python2.7/dist-packages/mercurial .  Debian puts
 the data files in the FHS compliant /usr/share/mercurial .  Fix the
 path only when run from the FHS compliant path
 (/usr/lib/pythonX.Y/dist-packages/mercurial) so as to not break the
 testsuite when building the package.
Author: Javi Merino <vicho@debian.org>

--- mercurial.orig/mercurial/util.py
+++ mercurial/mercurial/util.py
@@ -1658,6 +1658,8 @@ def pathto(root, n1, n2):
 if procutil.mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app':
     # executable version (py2exe) doesn't support __file__
     datapath = os.path.dirname(pycompat.sysexecutable)
+elif __file__.startswith("/usr/lib/python"):
+    datapath = "/usr/share/mercurial"
 else:
     datapath = os.path.dirname(pycompat.fsencode(__file__))