From 520a544ee5f90541b8a457b12d3d17f74f80d515 Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 7 Aug 2023 18:20:56 +0300 Subject: [PATCH] setup-hooks/strip: Create the log file in '$TMDPIR' vcunat said > This invocation of mktemp creates the file in the current directory, which is bad practice. We should add "--tmpdir=$TMPDIR" or make the template absolute. > I noticed because one package did cd $src during installing, which is a read-only path... --- pkgs/build-support/setup-hooks/strip.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh index 5f53e7e95b2e..d2422bb84234 100644 --- a/pkgs/build-support/setup-hooks/strip.sh +++ b/pkgs/build-support/setup-hooks/strip.sh @@ -65,7 +65,7 @@ stripDirs() { if [ -n "${paths}" ]; then echo "stripping (with command $cmd and flags $stripFlags) in $paths" local striperr - striperr="$(mktemp 'striperr.XXXXXX')" + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')" # Do not strip lib/debug. This is a directory used by setup-hooks/separate-debug-info.sh. find $paths -type f -a '!' -path "$prefix/lib/debug/*" -print0 | # Make sure we process files under symlinks only once. Otherwise