aboutsummaryrefslogtreecommitdiff
path: root/common/hooks
diff options
context:
space:
mode:
authorHelmut Pozimski <helmut@pozimski.eu>2020-07-16 17:44:01 +0000
committerPiotr <chocimier@tlen.pl>2020-08-25 19:18:59 +0000
commite0979275b4c6036f103c171cf60d2e57500d1167 (patch)
tree828615821a48eb93cc904f56a305822a477ddf4a /common/hooks
parentf431451ab060c3ba64a346b4d899621996053f7e (diff)
downloadvoid-packages-e0979275b4c6036f103c171cf60d2e57500d1167.tar
void-packages-e0979275b4c6036f103c171cf60d2e57500d1167.tar.gz
void-packages-e0979275b4c6036f103c171cf60d2e57500d1167.tar.bz2
void-packages-e0979275b4c6036f103c171cf60d2e57500d1167.tar.lz
void-packages-e0979275b4c6036f103c171cf60d2e57500d1167.tar.xz
void-packages-e0979275b4c6036f103c171cf60d2e57500d1167.tar.zst
void-packages-e0979275b4c6036f103c171cf60d2e57500d1167.zip
11-pkglint-elf-in-usrshare: allow explicit setting of exceptions
Co-authored-by: Piotr Wójcik <chocimier@tlen.pl>
Diffstat (limited to 'common/hooks')
-rw-r--r--common/hooks/post-install/11-pkglint-elf-in-usrshare.sh23
1 files changed, 20 insertions, 3 deletions
diff --git a/common/hooks/post-install/11-pkglint-elf-in-usrshare.sh b/common/hooks/post-install/11-pkglint-elf-in-usrshare.sh
index ff4f7789e86..bd0a4f25725 100644
--- a/common/hooks/post-install/11-pkglint-elf-in-usrshare.sh
+++ b/common/hooks/post-install/11-pkglint-elf-in-usrshare.sh
@@ -2,26 +2,43 @@
#
# This hook executes the following tasks:
# - Looks on all packages for binary files being installed to /usr/share
+# - Allows exceptions listed in $ignore_elf_files and $ignore_elf_dirs
hook() {
- local matches mime file
+ local matches mime file f prune_expr dir
if [ ! -d ${PKGDESTDIR}/usr/share ]; then
return 0
fi
+ if [ "${ignore_elf_dirs}" ]; then
+ for dir in ${ignore_elf_dirs}; do
+ if ! [ "${prune_expr}" ]; then
+ prune_expr="( -path ${PKGDESTDIR}${dir}"
+ else
+ prune_expr+=" -o -path ${PKGDESTDIR}${dir}"
+ fi
+ done
+ prune_expr+=" ) -prune -o "
+ fi
+
# Find all binaries in /usr/share and add them to the pool
while read -r f; do
mime="${f##*:}"
mime="${mime// /}"
file="${f%:*}"
+ file="${file#${PKGDESTDIR}}"
case "${mime}" in
# Note application/x-executable is missing which is present in most Electron apps
application/x-sharedlib*|application/x-pie-executable*)
- matches+=" ${file#$PKGDESTDIR}" ;;
+ if [[ ${ignore_elf_files} != *"${file}"* ]]; then
+ matches+=" ${file}"
+ fi
+ ;;
esac
- done < <(find $PKGDESTDIR/usr/share -type f | file --mime-type --files-from -)
+ done < <(find $PKGDESTDIR/usr/share $prune_expr -type f | file --mime-type --files-from -)
+ # Check passed if no packages in pool
if [ -z "$matches" ]; then
return 0
fi