Add a check that the package does not contain references to the
folder it was built in.

Fixes FS#14751

Signed -off-by: Allan McRae <[email protected]>
---
 scripts/makepkg.sh.in |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 66667f4..dd5f951 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -972,6 +972,13 @@ check_package() {
                        warning "$(gettext "Invalid backup entry : %s")" "$file"
                fi
        done
+
+       # check for references to the build directory
+       local ret=0
+       grep -R "${srcdir}" "${pkgdir}" &>/dev/null || ret=1
+       if [ $ret -eq 0 ]; then
+               warning "$(gettext "Package contains reference to %s")" 
"\$srcdir"
+       fi
 }
 
 create_package() {
-- 
1.6.5.1


Reply via email to