debug-viewer: Allow running uninstalled with symlink

When uninstalled, we look at the directory of the executable to find
the resources. This patch uses realpath in replacement to abspath so
the path get expended, and symlink are followed.
This commit is contained in:
Nicolas Dufresne 2016-05-03 15:47:32 -04:00
parent a22c16a112
commit 498e78897b

View file

@ -41,7 +41,7 @@ def main ():
installed = True installed = True
else: else:
# Substitution has not been run, we are running uninstalled: # Substitution has not been run, we are running uninstalled:
lib_dir = os.path.dirname (os.path.abspath (sys.argv[0])) lib_dir = os.path.dirname (os.path.realpath (sys.argv[0]))
installed = False installed = False
if lib_dir: if lib_dir:
@ -59,7 +59,7 @@ def main ():
GstDebugViewer.Paths.setup_installed (data_dir) GstDebugViewer.Paths.setup_installed (data_dir)
else: else:
# Assume that we reside inside the source dist. # Assume that we reside inside the source dist.
source_dir = os.path.dirname (os.path.abspath (sys.argv[0])) source_dir = os.path.dirname (os.path.realpath (sys.argv[0]))
GstDebugViewer.Paths.setup_uninstalled (source_dir) GstDebugViewer.Paths.setup_uninstalled (source_dir)
GstDebugViewer.run () GstDebugViewer.run ()