diff options
author | Stefano Stabellini | 2022-04-19 17:42:47 -0700 |
---|---|---|
committer | Stefano Stabellini | 2022-04-19 17:42:47 -0700 |
commit | 8c7c2d0166c59754cd30e2e3ea6e21a3cb52762b (patch) | |
tree | ea3ec5744b2b8e8597a2dacd6220c3382a4e636b /docker-extras/uboot-script-gen | |
parent | 6a46a56db54087e8ec60dfe0234670d63bb75f95 (diff) |
handle correctly symlinks in parent directories
Commit b9e2809fce57 introduced support for symlinks when specified in
the config file for one of the binaries, but it breaks if there is a
symlink in one of the parent directories.
This patch fixes the behavior by doing the following:
- get the absolute "real" path of the target file using realpath, not
resolving symlinks for the parameter path (parents still get resolved)
- get the absolute "real" path of the current directory using realpath
This is necessary so that the two paths match in terms of symlinks
resolution.
- strip the base directory from the absolute path.
The result is the target file with a path relative to the current
directory without symlink resolution, but correctly handling the case
where symlinks are presents in the parent directories.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
Tested-by: Andrei Cherechesu <andrei.cherechesu@oss.nxp.com>
Diffstat (limited to 'docker-extras/uboot-script-gen')
0 files changed, 0 insertions, 0 deletions