2019-01-07 19:05:15 +00:00
|
|
|
# vim: set ts=4 sw=4 et:
|
|
|
|
#
|
|
|
|
# This hook executes the following tasks:
|
|
|
|
# - Looks on all packages for binary files being installed to /usr/share
|
|
|
|
|
|
|
|
hook() {
|
2020-06-29 19:30:37 +00:00
|
|
|
local matches mime file
|
2019-01-07 19:05:15 +00:00
|
|
|
|
|
|
|
if [ ! -d ${PKGDESTDIR}/usr/share ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Find all binaries in /usr/share and add them to the pool
|
2019-01-10 02:40:54 +00:00
|
|
|
while read -r f; do
|
2020-06-29 19:30:37 +00:00
|
|
|
mime="${f##*:}"
|
|
|
|
mime="${mime// /}"
|
|
|
|
file="${f%:*}"
|
|
|
|
case "${mime}" in
|
2019-01-10 02:40:54 +00:00
|
|
|
# Note application/x-executable is missing which is present in most Electron apps
|
2019-01-07 19:05:15 +00:00
|
|
|
application/x-sharedlib*|application/x-pie-executable*)
|
2020-06-29 19:30:37 +00:00
|
|
|
matches+=" ${file#$PKGDESTDIR}" ;;
|
2019-01-07 19:05:15 +00:00
|
|
|
esac
|
2020-06-29 19:30:37 +00:00
|
|
|
done < <(find $PKGDESTDIR/usr/share -type f | file --mime-type --files-from -)
|
2019-01-07 19:05:15 +00:00
|
|
|
|
|
|
|
if [ -z "$matches" ]; then
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
msg_red "${pkgver}: ELF files found in /usr/share:\n"
|
|
|
|
for f in $matches; do
|
|
|
|
msg_red " ${f}\n"
|
|
|
|
done
|
|
|
|
msg_error "${pkgver}: cannot continue with installation!\n"
|
|
|
|
}
|