hooks: verify that fuzzy patches don't leak into $DESTDIR

This commit is contained in:
Đoàn Trần Công Danh 2025-04-10 19:38:27 +07:00
parent 9a362883a5
commit b75b703ea9

View file

@ -0,0 +1,22 @@
# vim: set ts=4 sw=4 et:
#
# This hook executes the following tasks:
# - Looks on all packages for *.orig files generated by patch on fuzzy match
hook() {
local matches mime file f prune_expr dir
while read -r file; do
basename="${file%.orig}"
if [ -f "$basename" ]; then
if [ -z "$matches" ]; then
matches=yes
msg_red "Fuzzy patches generate those files:\n"
fi
msg_red " $file\n"
fi
done < <(find $PKGDESTDIR -type f -name '*.orig')
if [ "$matches" ]; then
msg_error "Please refresh the patches\n"
fi
}