xbps-src: make sure to not propagate <subpkg>_package() funcs.
Unset all them before processing a new template. Close #1023
This commit is contained in:
parent
2d1a45ccb1
commit
a4ff74aeb6
1 changed files with 17 additions and 11 deletions
|
@ -165,7 +165,7 @@ source_file() {
|
|||
}
|
||||
|
||||
run_pkg_hooks() {
|
||||
local phase="$1" hookn
|
||||
local phase="$1" hookn f
|
||||
|
||||
eval unset -f hook
|
||||
for f in ${XBPS_COMMONDIR}/hooks/${phase}/*.sh; do
|
||||
|
@ -177,6 +177,14 @@ run_pkg_hooks() {
|
|||
done
|
||||
}
|
||||
|
||||
unset_package_funcs() {
|
||||
local f
|
||||
|
||||
for f in $(typeset -F|grep -E '_package$'); do
|
||||
eval unset -f $f
|
||||
done
|
||||
}
|
||||
|
||||
get_subpkgs() {
|
||||
local args list
|
||||
|
||||
|
@ -192,23 +200,21 @@ get_subpkgs() {
|
|||
|
||||
setup_pkg() {
|
||||
local pkg="$1" cross="$2"
|
||||
local val _vars f
|
||||
local val _vars f dbgflags
|
||||
|
||||
[ -z "$pkg" ] && return 1
|
||||
|
||||
# Start with a sane environment
|
||||
unset -v PKG_BUILD_OPTIONS XBPS_CROSS_CFLAGS XBPS_CROSS_CXXFLAGS XBPS_CROSS_CPPFLAGS XBPS_CROSS_LDFLAGS
|
||||
unset -v run_depends build_depends host_build_depends
|
||||
unset -v subpackages run_depends build_depends host_build_depends
|
||||
|
||||
for f in ${subpackages}; do
|
||||
eval unset -f ${f}_package
|
||||
done
|
||||
unset_package_funcs
|
||||
|
||||
if [ -n "$cross" ]; then
|
||||
source_file $XBPS_CROSSPFDIR/${cross}.sh
|
||||
|
||||
REQ_VARS="TARGET_ARCH CROSS_TRIPLET CROSS_CFLAGS CROSS_CXXFLAGS"
|
||||
for f in ${REQ_VARS}; do
|
||||
_vars="TARGET_ARCH CROSS_TRIPLET CROSS_CFLAGS CROSS_CXXFLAGS"
|
||||
for f in ${_vars}; do
|
||||
eval val="\$XBPS_$f"
|
||||
if [ -z "$val" ]; then
|
||||
echo "ERROR: XBPS_$f is not defined!"
|
||||
|
@ -244,13 +250,13 @@ setup_pkg() {
|
|||
XBPS_REMOVE_XCMD XBPS_RINDEX_XCMD XBPS_UHELPER_XCMD
|
||||
|
||||
# Source all sourcepkg environment setup snippets.
|
||||
for f in ${XBPS_COMMONDIR}/environment/setup/*.sh; do
|
||||
source_file "$f"
|
||||
done
|
||||
# Source all subpkg environment setup snippets.
|
||||
for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
|
||||
source_file "$f"
|
||||
done
|
||||
for f in ${XBPS_COMMONDIR}/environment/setup/*.sh; do
|
||||
source_file "$f"
|
||||
done
|
||||
|
||||
if [ ! -f ${XBPS_SRCPKGDIR}/${pkg}/template ]; then
|
||||
msg_error "xbps-src: unexistent file: ${XBPS_SRCPKGDIR}/${pkg}/template\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue