setup/hg: handle hg being a symlink when appending relative libdir to sys.path stable
authorL. David Baron <dbaron@dbaron.org>
Thu, 21 Oct 2010 09:58:22 -0700
branchstable
changeset 12805 cae1c187abd4
parent 12804 e0e8b123b75e
child 12806 57b9fd75b6f8
setup/hg: handle hg being a symlink when appending relative libdir to sys.path Resolve symbolic links in the path to hg so that an hg that works when invoked directly will also work when invoked via a symlink to it.
hg
--- a/hg	Thu Oct 21 21:34:30 2010 +0200
+++ b/hg	Thu Oct 21 09:58:22 2010 -0700
@@ -14,7 +14,8 @@
 
 if libdir != '@' 'LIBDIR' '@':
     if not os.path.isabs(libdir):
-        libdir = os.path.join(os.path.dirname(__file__), libdir)
+        libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                              libdir)
         libdir = os.path.abspath(libdir)
     sys.path.insert(0, libdir)