BuildSourceImage: naive relative symlink path

Fixes #44

This does not account for the `${artifact_path}` potentially being
nested.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2019-09-26 15:50:55 -04:00
parent 599c0eb13f
commit cd0bcd3c6b

View file

@ -641,11 +641,11 @@ layout_insert_bash() {
if [ "$(basename "${tar_path}")" == "$(basename "${artifact_path}")" ] ; then
_mkdir_p "${tmpdir}/$(dirname "${tar_path}")"
# TODO this symlink need to be relative path, not to `/blobs/...`
ln -s "/blobs/sha256/${sum}" "${tmpdir}/${tar_path}"
ln -s "../blobs/sha256/${sum}" "${tmpdir}/${tar_path}"
else
_mkdir_p "${tmpdir}/${tar_path}"
# TODO this symlink need to be relative path, not to `/blobs/...`
ln -s "/blobs/sha256/${sum}" "${tmpdir}/${tar_path}/$(basename "${artifact_path}")"
ln -s "../blobs/sha256/${sum}" "${tmpdir}/${tar_path}/$(basename "${artifact_path}")"
fi
tmptar="$(_mktemp)"