diff options
author | Sam James <sam@gentoo.org> | 2023-06-10 07:48:22 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-06-10 07:50:47 +0100 |
commit | 681ca5418e6a79fdf0e5213e672b568c055ba83a (patch) | |
tree | 22d257761a7e2cc1b25a0ea21c0abf4db4996a0c | |
parent | profiles: move dev-python/bracex[doc] mask to wd40 for relevant arches (diff) | |
download | gentoo-681ca5418e6a79fdf0e5213e672b568c055ba83a.tar.gz gentoo-681ca5418e6a79fdf0e5213e672b568c055ba83a.tar.bz2 gentoo-681ca5418e6a79fdf0e5213e672b568c055ba83a.zip |
cargo.eclass: make cargo_live_src_unpack idempotent
Allow multiple calls w/ different S set by guarding the symlink creation.
Bug: https://bugs.gentoo.org/902725
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | eclass/cargo.eclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass index 7e6fe5c55f9e..991e808d453f 100644 --- a/eclass/cargo.eclass +++ b/eclass/cargo.eclass @@ -403,8 +403,8 @@ cargo_live_src_unpack() { # Users may have git checkouts made by cargo. # While cargo vendors the sources, it still needs git checkout to be present. - # Copying full dir is an overkill, so just symlink it. - if [[ -d ${ECARGO_REGISTRY_DIR}/git ]]; then + # Copying full dir is overkill, so just symlink it (guard w/ -L to keep idempotent). + if [[ -d ${ECARGO_REGISTRY_DIR}/git && ! -L "${ECARGO_HOME}/git" ]]; then ln -sv "${ECARGO_REGISTRY_DIR}/git" "${ECARGO_HOME}/git" || die fi |