Add a setup hook for detecting $TMPDIR references in RPATHs and wrapper scripts

This commit is contained in:
Eelco Dolstra
2017-05-04 20:23:57 +02:00
parent 3b8f8951db
commit 94d164dd7f
3 changed files with 54 additions and 0 deletions
+1
View File
@@ -94,6 +94,7 @@ let
../../build-support/setup-hooks/compress-man-pages.sh
../../build-support/setup-hooks/strip.sh
../../build-support/setup-hooks/patch-shebangs.sh
../../build-support/setup-hooks/audit-tmpdir.sh
../../build-support/setup-hooks/multiple-outputs.sh
../../build-support/setup-hooks/move-sbin.sh
../../build-support/setup-hooks/move-lib64.sh
+12
View File
@@ -199,6 +199,18 @@ isELF() {
if [[ "$magic" =~ ELF ]]; then return 0; else return 1; fi
}
# Return success if the specified file is a script (i.e. starts with
# "#!").
isScript() {
local fn="$1"
local magic
if ! [ -x /bin/sh ]; then return 0; fi
exec {fd}< "$fn"
read -n 2 -u $fd magic
exec {fd}<&-
if [[ "$magic" =~ \#! ]]; then return 0; else return 1; fi
}
######################################################################
# Initialisation.