From 865fa5013c9189f6d7578c348a658a873cf3b672 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 17 Jan 2025 16:37:26 -0800 Subject: [PATCH] no-broken-symlinks: guard against double inclusions --- pkgs/build-support/setup-hooks/no-broken-symlinks.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/build-support/setup-hooks/no-broken-symlinks.sh b/pkgs/build-support/setup-hooks/no-broken-symlinks.sh index 26f4838af5a8f4..8117da45d80d4e 100644 --- a/pkgs/build-support/setup-hooks/no-broken-symlinks.sh +++ b/pkgs/build-support/setup-hooks/no-broken-symlinks.sh @@ -1,4 +1,12 @@ # shellcheck shell=bash + +# Guard against double inclusion. +if (("${noBrokenSymlinksHookInstalled:-0}" > 0)); then + nixInfoLog "skipping because the hook has been propagated more than once" + return 0 +fi +declare -ig noBrokenSymlinksHookInstalled=1 + # symlinks are often created in postFixup # don't use fixupOutputHooks, it is before postFixup postFixupHooks+=(noBrokenSymlinksInAllOutputs)