From 29014bdc04140941ecb5f17aeb065fcb56dbc5b5 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 27 Feb 2023 18:36:48 +0100 Subject: [PATCH] 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 9b7ffab18..a5fc45500 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 }