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...
This commit is contained in:
Artturin 2023-08-07 18:20:56 +03:00
parent 053e9ef8df
commit 520a544ee5

View File

@ -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