forked from mirrors/nixpkgs
Merge pull request #66725 from flokli/wrapqtappshook-exec
stdenv: add isELFExec, isELFDyn, fix wrappers
This commit is contained in:
commit
dbd7ea5f29
|
@ -82,7 +82,7 @@ wrapQtAppsHook() {
|
|||
|
||||
find "$targetDir" -executable -print0 | while IFS= read -r -d '' file
|
||||
do
|
||||
isELF "$file" || continue
|
||||
isELFExec "$file" || continue
|
||||
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
|
|
|
@ -212,6 +212,18 @@ isELF() {
|
|||
if [ "$magic" = $'\177ELF' ]; then return 0; else return 1; fi
|
||||
}
|
||||
|
||||
# Return success if the specified file is an ELF object
|
||||
# and its e_type is ET_EXEC (executable file)
|
||||
isELFExec() {
|
||||
grep -ao -P '^\177ELF.{11}\x00\x02' "$1" >/dev/null
|
||||
}
|
||||
|
||||
# Return success if the specified file is an ELF object
|
||||
# and its e_type is ET_DYN (shared object file)
|
||||
isELFDyn() {
|
||||
grep -ao -P '^\177ELF.{11}\x00\x03' "$1" >/dev/null
|
||||
}
|
||||
|
||||
# Return success if the specified file is a script (i.e. starts with
|
||||
# "#!").
|
||||
isScript() {
|
||||
|
|
Loading…
Reference in a new issue