From b75b703ea97f63b75a5d45fcb0fcefedd6959214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 10 Apr 2025 19:38:27 +0700 Subject: [PATCH] hooks: verify that fuzzy patches don't leak into $DESTDIR --- .../post-install/11-pkglint-patch-orig.sh | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 common/hooks/post-install/11-pkglint-patch-orig.sh diff --git a/common/hooks/post-install/11-pkglint-patch-orig.sh b/common/hooks/post-install/11-pkglint-patch-orig.sh new file mode 100644 index 00000000000..edf6d2ca1bb --- /dev/null +++ b/common/hooks/post-install/11-pkglint-patch-orig.sh @@ -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 +}