hooks/pkglint-elf-in-usrshare: speed up by only starting file once
This commit is contained in:
parent
96d2390578
commit
c677edf2b3
1 changed files with 7 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
||||||
# - Looks on all packages for binary files being installed to /usr/share
|
# - Looks on all packages for binary files being installed to /usr/share
|
||||||
|
|
||||||
hook() {
|
hook() {
|
||||||
local matches
|
local matches mime file
|
||||||
|
|
||||||
if [ ! -d ${PKGDESTDIR}/usr/share ]; then
|
if [ ! -d ${PKGDESTDIR}/usr/share ]; then
|
||||||
return 0
|
return 0
|
||||||
|
@ -12,12 +12,15 @@ hook() {
|
||||||
|
|
||||||
# Find all binaries in /usr/share and add them to the pool
|
# Find all binaries in /usr/share and add them to the pool
|
||||||
while read -r f; do
|
while read -r f; do
|
||||||
case "$(file -bi "$f")" in
|
mime="${f##*:}"
|
||||||
|
mime="${mime// /}"
|
||||||
|
file="${f%:*}"
|
||||||
|
case "${mime}" in
|
||||||
# Note application/x-executable is missing which is present in most Electron apps
|
# Note application/x-executable is missing which is present in most Electron apps
|
||||||
application/x-sharedlib*|application/x-pie-executable*)
|
application/x-sharedlib*|application/x-pie-executable*)
|
||||||
matches+=" ${f#$PKGDESTDIR}" ;;
|
matches+=" ${file#$PKGDESTDIR}" ;;
|
||||||
esac
|
esac
|
||||||
done < <(find $PKGDESTDIR/usr/share -type f)
|
done < <(find $PKGDESTDIR/usr/share -type f | file --mime-type --files-from -)
|
||||||
|
|
||||||
if [ -z "$matches" ]; then
|
if [ -z "$matches" ]; then
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue