build-dotnet-module/fetch-deps: fixup temp naming when pname has a capital X in it

For example, this script doesn't work for `xivlauncher` because its
proper `pname` is `XIVLauncher`, and `mktemp` complains about "too few
X's":

    $ mktemp -td "XXXXXX-XIVLauncher-home"
    mktemp: too few X's in template ‘XXXXXX-XIVLauncher-home’

vs

    $ mktemp -td "XIVLauncher-home-XXXXXX"
    /tmp/XIVLauncher-home-EdGMei
This commit is contained in:
Cole Helbling 2022-09-16 09:18:22 -07:00
parent 2b202714a2
commit e97ee029b4

View File

@ -180,12 +180,12 @@ in stdenvNoCC.mkDerivation (args // {
;;
esac
deps_file="$(realpath "''${1:-$(mktemp -t "XXXXXX-${pname}-deps.nix")}")"
export HOME=$(mktemp -td "XXXXXX-${pname}-home")
deps_file="$(realpath "''${1:-$(mktemp -t "${pname}-deps-XXXXXX.nix")}")"
export HOME=$(mktemp -td "${pname}-home-XXXXXX")
mkdir -p "$HOME/nuget_pkgs"
store_src="${srcOnly args}"
src="$(mktemp -td "XXXXXX-${pname}-src")"
src="$(mktemp -td "${pname}-src-XXXXXX")"
cp -rT "$store_src" "$src"
chmod -R +w "$src"
trap "rm -rf $src $HOME" EXIT