common/xbps-src/shutils/common: only complain about do_install in main pkg

this file is also sourced during subpackage install, so a metapackage
that has non-meta subpackages will source this and scream because there
is no do_install
This commit is contained in:
classabbyamp 2025-06-12 23:29:17 -04:00
parent 97618aeef1
commit 2d3f6aadf5
No known key found for this signature in database
GPG key ID: 6BE0755918A4C7F5

View file

@ -526,7 +526,7 @@ setup_pkg() {
# If build_style is unset, a do_install() function must be defined. # If build_style is unset, a do_install() function must be defined.
if [ -z "$build_style" ]; then if [ -z "$build_style" ]; then
# Check that at least do_install() is defined. # Check that at least do_install() is defined.
if [ "$metapackage" != yes ] && ! declare -f do_install >/dev/null; then if [ "$metapackage" != yes ] && ! declare -f do_install >/dev/null && [ "${pkgname}" = "${sourcepkg}" ]; then
msg_error "$pkgver: missing do_install() function!\n" msg_error "$pkgver: missing do_install() function!\n"
fi fi
elif [ "$build_style" = meta ]; then elif [ "$build_style" = meta ]; then