Permalink
Browse files

Resolve all symlinks in path (bug 2064)

  • Loading branch information...
1 parent df4ca76 commit bd1e652ae23a4fc3fa90488ce1ec171576f2e53a @thp thp committed Feb 21, 2016
Showing with 3 additions and 6 deletions.
  1. +1 −2 bin/gpo
  2. +1 −2 bin/gpodder
  3. +1 −2 bin/gpodder-migrate2tres
View
@@ -98,8 +98,7 @@ for flag in ('-v', '--verbose'):
break
gpodder_script = sys.argv[0]
-if os.path.islink(gpodder_script):
- gpodder_script = os.readlink(gpodder_script)
+gpodder_script = os.path.realpath(gpodder_script)
gpodder_dir = os.path.join(os.path.dirname(gpodder_script), '..')
# TODO: Read parent directory links as well (/bin -> /usr/bin, like on Fedora, see Bug #1618)
# This would allow /usr/share/gpodder/ (not /share/gpodder/) to be found from /bin/gpodder
View
@@ -53,8 +53,7 @@ from optparse import OptionParser
def main():
# Paths to important files
gpodder_script = sys.argv[0]
- while os.path.islink(gpodder_script):
- gpodder_script = os.readlink(gpodder_script)
+ gpodder_script = os.path.realpath(gpodder_script)
gpodder_dir = os.path.join(os.path.dirname(gpodder_script), '..')
prefix = os.path.abspath(os.path.normpath(gpodder_dir))
View
@@ -31,8 +31,7 @@ import ConfigParser
import shutil
gpodder_script = sys.argv[0]
-if os.path.islink(gpodder_script):
- gpodder_script = os.readlink(gpodder_script)
+gpodder_script = os.path.realpath(gpodder_script)
gpodder_dir = os.path.join(os.path.dirname(gpodder_script), '..')
prefix = os.path.abspath(os.path.normpath(gpodder_dir))

0 comments on commit bd1e652

Please sign in to comment.