From 33e3afecf94539d08144db357ccd5818803b63b9 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 13 Nov 2015 13:05:36 +0100 Subject: xbps-src: do not allow empty PKGDESTDIR unless build_style!=meta. --- common/hooks/pre-pkg/99-pkglint.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'common/hooks/pre-pkg') diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh index c79c798ed9f..d42877814b6 100644 --- a/common/hooks/pre-pkg/99-pkglint.sh +++ b/common/hooks/pre-pkg/99-pkglint.sh @@ -32,16 +32,24 @@ hook() { fi done + # Forbid empty packages unless build_style=meta + if [ "$build_style" != "meta" ]; then + if [ "$(find $PKGDESTDIR/* -maxdepth 1 -type d 2>/dev/null)" = "" ]; then + msg_red "${pkgver}: PKGDESTDIR is empty and build_style != meta\n" + error=1 + fi + fi + if [ $error -gt 0 ]; then msg_error "${pkgver}: cannot continue with installation!\n" fi # Check for missing shlibs and SONAME bumps. - if [ ! -f "${PKGDESTDIR}/shlib-provides" ]; then + if [ ! -s "${PKGDESTDIR}/shlib-provides" ]; then return 0 fi - for filename in `cat ${PKGDESTDIR}/shlib-provides`; do + for filename in $(cat ${PKGDESTDIR}/shlib-provides); do rev=${filename#*.so.} libname=${filename%.so*} _shlib=$(echo "$libname"|sed -E 's|\+|\\+|g') -- cgit v1.2.3