3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #66725 from flokli/wrapqtappshook-exec

stdenv: add isELFExec, isELFDyn, fix wrappers
This commit is contained in:
Florian Klink 2019-08-18 13:58:10 +02:00 committed by GitHub
commit dbd7ea5f29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

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

View file

@ -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() {