diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index fe4ad7e8cf..3b5ed25a17 100644 --- a/xbps-src/shutils/tmpl_funcs.sh.in +++ b/xbps-src/shutils/tmpl_funcs.sh.in @@ -105,7 +105,7 @@ reset_tmpl_vars() ignore_vdeps_dir noverifyrdeps conflicts dkms_modules \ gconf_entries gconf_schemas stow_copy stow_copy_files \ pre_remove post_remove post_stow do_build do_install \ - homepage license kernel_hooks_version \ + homepage license kernel_hooks_version SUBPKG \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ XBPS_BUILD_DONE XBPS_INSTALL_DONE FILESDIR DESTDIR \ SRCPKGDESTDIR PATCHESDIR CFLAGS CXXFLAGS CPPFLAGS \ @@ -142,6 +142,8 @@ setup_tmpl() setup_subpkg_tmpl() { + local f + [ -z "$1" ] && return 1 if [ -r "$XBPS_SRCPKGDIR/$1/$1.template" ]; then @@ -149,11 +151,11 @@ setup_subpkg_tmpl() unset run_depends build_depends . $XBPS_SRCPKGDIR/$1/$1.template for f in ${subpackages}; do - if [ "$subpkg" = "$1" ]; then - pkgname=$subpkg - set_tmpl_common_vars - break - fi + [ "$f" != "$1" ] && continue + pkgname=$f + set_tmpl_common_vars + SUBPKG=1 + break done else setup_tmpl $1