nixos/systemd-boot: Use os.path.realpath to fully resolve symlinks

os.readlink only resolves one layer of symlinks. This script explicitly relies on the real path of a file for deduplication, hence symlink resolution should recurse.
This commit is contained in:
Max 2021-06-24 17:52:03 +02:00 committed by GitHub
parent 21e25c659f
commit 2cf6f9e5bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,7 +61,7 @@ def write_loader_conf(profile: Optional[str], generation: int) -> None:
def profile_path(profile: Optional[str], generation: int, name: str) -> str:
return os.readlink("%s/%s" % (system_dir(profile, generation), name))
return os.path.realpath("%s/%s" % (system_dir(profile, generation), name))
def copy_from_profile(profile: Optional[str], generation: int, name: str, dry_run: bool = False) -> str: