patch-nupkgs: fix race when patching incomplete package

This commit is contained in:
David McFarland 2024-04-03 20:01:38 -03:00
parent b2c788ad1b
commit b3b68a6687
1 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,9 @@ in writeShellScriptBin "patch-nupkgs" ''
}
cd "$1"
for x in *.${buildRid}/* *.${buildRid}.*/*; do
[[ -d "$x" ]] && [[ ! -f "$x"/.nix-patched ]] || continue
# .nupkg.metadata is written last, so we know the packages is complete
[[ -d "$x" ]] && [[ -f "$x"/.nupkg.metadata ]] \
&& [[ ! -f "$x"/.nix-patched ]] || continue
echo "Patching package $x"
pushd "$x"
for p in $(find -type f); do