Package: mercurial / 4.0-1+deb9u1

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>

--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -935,6 +935,8 @@ def mainfrozen():
 if mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app':
     # executable version (py2exe) doesn't support __file__
     datapath = os.path.dirname(sys.executable)
+elif __file__.startswith("/usr/lib/python"):
+    datapath = "/usr/share/mercurial"
 else:
     datapath = os.path.dirname(__file__)