1 # vim: set ts=4 sw=4 et:
3 # This hook executes the following tasks:
4 # - Looks on all packages for binary files being installed to /usr/share
5 # - Allows exceptions listed in $ignore_elf_files and $ignore_elf_dirs
8 local matches mime
file f prune_expr dir
10 if [ ! -d ${PKGDESTDIR}/usr
/share
]; then
14 if [ "${ignore_elf_dirs}" ]; then
15 for dir
in ${ignore_elf_dirs}; do
16 if ! [ "${prune_expr}" ]; then
17 prune_expr
="( -path ${PKGDESTDIR}${dir}"
19 prune_expr
+=" -o -path ${PKGDESTDIR}${dir}"
22 prune_expr
+=" ) -prune -o "
25 # Find all binaries in /usr/share and add them to the pool
29 file="${file#${PKGDESTDIR}}"
31 application
/x-sharedlib
*|\
32 application
/x-pie-executable
*|\
33 application
/x-executable
*)
34 if [[ ${ignore_elf_files} != *"${file}"* ]]; then
39 done < <(find $PKGDESTDIR/usr
/share
$prune_expr -type f |
file --no-pad --mime-type --files-from -)
41 # Check passed if no packages in pool
42 if [ -z "$matches" ]; then
46 msg_red
"${pkgver}: ELF files found in /usr/share:\n"
50 msg_error
"${pkgver}: cannot continue with installation!\n"