From: Daniel Hahler Date: Sat, 12 May 2012 19:28:22 +0000 (-0500) Subject: Resolve bup argv[0] symlinks. X-Git-Tag: bup-0.25-rc2~150 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=bup.git;a=commitdiff_plain;h=39a14333f8737923ab958dcb31fe3cae7a8a83eb Resolve bup argv[0] symlinks. Resolve any symlinks in argv[0] so that the subsequent PYTHONPATH adjustment will work properly. Signed-off-by: Daniel Hahler Acked-by: Gabriel Filion Reviewed-by: Rob Browning --- diff --git a/main.py b/main.py index c8ffce2..5229b26 100755 --- a/main.py +++ b/main.py @@ -2,7 +2,7 @@ import sys, os, subprocess, signal, getopt argv = sys.argv -exe = argv[0] +exe = os.path.realpath(argv[0]) exepath = os.path.split(exe)[0] or '.' exeprefix = os.path.split(os.path.abspath(exepath))[0]