about summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-08-07 18:20:56 +0300
committerArtturin <Artturin@artturin.com>2023-08-07 18:20:56 +0300
commit520a544ee5f90541b8a457b12d3d17f74f80d515 (patch)
tree99a1f0d60ef72a60104292cc95424cbedfea5901 /pkgs/build-support/setup-hooks
parent053e9ef8df89bc113f02c9f51e31efc8f4f9e46f (diff)
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...
Diffstat (limited to 'pkgs/build-support/setup-hooks')
-rw-r--r--pkgs/build-support/setup-hooks/strip.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh
index 5f53e7e95b2ef..d2422bb84234f 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