Skip to content

Commit

Permalink
Resolve all symlinks in path (bug 2064)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed Feb 21, 2016
1 parent df4ca76 commit bd1e652
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions bin/gpo
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions bin/gpodder
Expand Up @@ -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))

Expand Down
3 changes: 1 addition & 2 deletions bin/gpodder-migrate2tres
Expand Up @@ -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))

Expand Down

0 comments on commit bd1e652

Please sign in to comment.