From bd791d61f176bbd50f8d3a47a69c25f1d6fc34b0 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Mon, 27 Feb 2023 18:36:48 +0100
Subject: [PATCH 10/N] makepkg: lint_package: Warn on package files
 referencing absolute Windows paths

---
 scripts/libmakepkg/lint_package/build_references.sh.in | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scripts/libmakepkg/lint_package/build_references.sh.in b/scripts/libmakepkg/lint_package/build_references.sh.in
index 5aea78f..a941e2f 100644
--- a/scripts/libmakepkg/lint_package/build_references.sh.in
+++ b/scripts/libmakepkg/lint_package/build_references.sh.in
@@ -37,5 +37,13 @@ warn_build_references() {
 			printf '%s\n' "${refs[@]#"$pkgdir/"}" >&2
 		fi
 	done
+
+	# Check for Windows-style MSYS2 root path
+	if find "${pkgdir}" -type f -print0 | xargs -0 grep -iFqI "$(cygpath -m /)" ; then
+		warning "$(gettext "Package contains reference to %s")" "\$(cygpath -m /)"
+	fi
+	if find "${pkgdir}" -type f -print0 | xargs -0 grep -iFqI "$(cygpath -w /)" ; then
+		warning "$(gettext "Package contains reference to %s")" "\$(cygpath -w /)"
+	fi
 	return 0
 }
