Read relative symlinks correctly in staging_dir_builder
Some symlinks are now relative. When using readlink(), we were resolving
those relative paths, but using them as relative to the current working
directory rather than relative to the symlink.
The workaround before was to assume that the symlinks were always
emitting enough ../'s to reach the root of the execroot from their
location. Then we would find the execroot ourselves, realtive to the
cwd instead of relative to the symlink, and change the number of ../'s
in the symlink's path.
Instead, just join the symlink target with the symlink's location, so
we use it's value relative to the symlink itself.
Bug: 259191764
Test: m && (move source tree and prepare_moved_top.sh) && m
Change-Id: I08d5039046ddf527df556251ddfb64ec5a93a118
1 file changed