summaryrefslogtreecommitdiff
path: root/eclass/cargo.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/cargo.eclass')
-rw-r--r--eclass/cargo.eclass4
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