Fix #271: properly resolve symlinks in all paths (#329)

I've replaced all instances in the code of `os.path.abspath`
with `os.path.realpath`, as this does the same as `abspath`
plus resolving symlinks.
See also: https://stackoverflow.com/a/40311142
This commit is contained in:
Oliver Smith 2017-08-15 14:08:48 +00:00 committed by GitHub
parent 2f8d589ed6
commit ff9f2d620f
19 changed files with 24 additions and 24 deletions

View file

@ -21,7 +21,7 @@ import sys
import pytest
# Import from parent directory
sys.path.append(os.path.abspath(
sys.path.append(os.path.realpath(
os.path.join(os.path.dirname(__file__) + "/..")))
import pmb.build.other
import pmb.chroot.apk
@ -84,7 +84,7 @@ def out_of_sync_files(args):
def test_aport_in_sync_with_git(args):
aports = temp_aports_repo(args)
ret_in_sync = []
ret_out_of_sync = [args.aports + "/main/alpine-base/APKBUILD"]
ret_out_of_sync = [os.path.realpath(args.aports + "/main/alpine-base/APKBUILD")]
# In sync (no files changed)
assert out_of_sync_files(args) == ret_in_sync