1
0
Fork 0
mirror of https://github.com/xHyroM/void-packages.git synced 2024-11-14 02:48:06 +01:00
void-packages/common/hooks/post-install/99-pkglint-warn-cross-cruft.sh

22 lines
538 B
Bash
Raw Normal View History

2024-03-29 08:12:19 +01:00
# This hook warns if :
# - Any text file /usr/{bin,lib,libexec,share} contains $XBPS_CROSS_BASE
# - Any text file /usr/{bin,lib,libexec,share} contains $XBPS_WRAPPERDIR
hook() {
if [ -z "$CROSS_BUILD" ]; then
return 0
fi
for d in bin lib libexec share; do
for f in $PKGDESTDIR/usr/$d/* $PKGDESTDIR/usr/$d/**/*; do
case "$(file -bi "$f")" in
text/*) if grep -q -e "$XBPS_CROSS_BASE" \
-e "$XBPS_WRAPPERDIR" "$f"; then
msg_warn "${f#$PKGDESTDIR} has cross cruft\n"
fi
;;
esac
done
done
return 0;
}