shutils: return proper error in {do,pre,post}_* stage funcs and use msg_error.
--HG-- extra : convert_revision : xtraeme%40gmail.com-20091012220713-k3j00b7x3jk5s3we
This commit is contained in:
parent
cf7b3caebe
commit
9296d25811
@ -58,7 +58,7 @@ build_src_phase()
|
|||||||
[ -z "$make_cmd" ] && make_cmd=/usr/bin/make
|
[ -z "$make_cmd" ] && make_cmd=/usr/bin/make
|
||||||
|
|
||||||
# Run pre_build func.
|
# Run pre_build func.
|
||||||
run_func pre_build
|
run_func pre_build || msg_error "pre_build stage failed!"
|
||||||
|
|
||||||
[ -n "$XBPS_MAKEJOBS" -a -z "$disable_parallel_build" ] && \
|
[ -n "$XBPS_MAKEJOBS" -a -z "$disable_parallel_build" ] && \
|
||||||
makejobs="-j$XBPS_MAKEJOBS"
|
makejobs="-j$XBPS_MAKEJOBS"
|
||||||
@ -80,7 +80,7 @@ build_src_phase()
|
|||||||
[ $? -ne 0 ] && msg_error "building $pkg (build phase)."
|
[ $? -ne 0 ] && msg_error "building $pkg (build phase)."
|
||||||
|
|
||||||
# Run post_build func.
|
# Run post_build func.
|
||||||
run_func post_build
|
run_func post_build || msg_error "post_build stage failed!"
|
||||||
|
|
||||||
unset makejobs
|
unset makejobs
|
||||||
|
|
||||||
|
@ -33,7 +33,10 @@ run_func()
|
|||||||
[ -z "$func" ] && return 1
|
[ -z "$func" ] && return 1
|
||||||
|
|
||||||
type -t $func | grep -q 'function'
|
type -t $func | grep -q 'function'
|
||||||
[ $? -eq 0 ] && $func
|
if [ $? -eq 0 ]; then
|
||||||
|
$func
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_rootcmd()
|
run_rootcmd()
|
||||||
|
@ -62,7 +62,7 @@ configure_src_phase()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run pre_configure func.
|
# Run pre_configure func.
|
||||||
run_func pre_configure
|
run_func pre_configure || msg_error "pre_configure stage failed!"
|
||||||
|
|
||||||
# Export configure_env vars.
|
# Export configure_env vars.
|
||||||
for f in ${configure_env}; do
|
for f in ${configure_env}; do
|
||||||
@ -124,7 +124,7 @@ configure_src_phase()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run post_configure func.
|
# Run post_configure func.
|
||||||
run_func post_configure
|
run_func post_configure || msg_error "post_configure stage failed!"
|
||||||
|
|
||||||
# unset configure_env vars.
|
# unset configure_env vars.
|
||||||
for f in ${configure_env}; do
|
for f in ${configure_env}; do
|
||||||
|
@ -49,12 +49,10 @@ install_src_phase()
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! -d $wrksrc ] && msg_error "unexistent build directory [$wrksrc]"
|
cd $wrksrc || msg_error "can't change cwd to wrksrc!"
|
||||||
|
|
||||||
cd $wrksrc || exit 1
|
|
||||||
|
|
||||||
# Run pre_install func.
|
# Run pre_install func.
|
||||||
run_func pre_install
|
run_func pre_install || msg_error "pre_install stage failed!"
|
||||||
|
|
||||||
msg_normal "Running install phase for $pkgname-$lver."
|
msg_normal "Running install phase for $pkgname-$lver."
|
||||||
|
|
||||||
@ -65,13 +63,13 @@ install_src_phase()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$build_style" = "custom-install" ]; then
|
if [ "$build_style" = "custom-install" ]; then
|
||||||
run_func do_install
|
run_func do_install || msg_error "do_install stage failed!"
|
||||||
else
|
else
|
||||||
make_install $lver
|
make_install $lver
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run post_install func.
|
# Run post_install func.
|
||||||
run_func post_install
|
run_func post_install || msg_error "post_install stage failed!"
|
||||||
|
|
||||||
# Remove libtool archives from pkg destdir.
|
# Remove libtool archives from pkg destdir.
|
||||||
if [ -z "$libtool_no_delete_archives" ]; then
|
if [ -z "$libtool_no_delete_archives" ]; then
|
||||||
@ -110,7 +108,8 @@ install_src_phase()
|
|||||||
. $XBPS_TEMPLATESDIR/$pkgname/$subpkg.template
|
. $XBPS_TEMPLATESDIR/$pkgname/$subpkg.template
|
||||||
pkgname=${sourcepkg}-${subpkg}
|
pkgname=${sourcepkg}-${subpkg}
|
||||||
set_tmpl_common_vars
|
set_tmpl_common_vars
|
||||||
run_func do_install
|
run_func do_install || \
|
||||||
|
msg_error "$pkgname do_install stage failed!"
|
||||||
run_template ${sourcepkg}
|
run_template ${sourcepkg}
|
||||||
[ "$pkg" = "${sourcepkg}-${subpkg}" ] && break
|
[ "$pkg" = "${sourcepkg}-${subpkg}" ] && break
|
||||||
done
|
done
|
||||||
@ -120,8 +119,7 @@ install_src_phase()
|
|||||||
# Remove $wrksrc if -C not specified.
|
# Remove $wrksrc if -C not specified.
|
||||||
#
|
#
|
||||||
if [ -d "$wrksrc" -a -z "$dontrm_builddir" ]; then
|
if [ -d "$wrksrc" -a -z "$dontrm_builddir" ]; then
|
||||||
rm -rf $wrksrc
|
rm -rf $wrksrc && \
|
||||||
[ $? -eq 0 ] && \
|
|
||||||
msg_normal "Removed $pkgname-$lver build directory."
|
msg_normal "Removed $pkgname-$lver build directory."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -147,10 +145,7 @@ make_install()
|
|||||||
# Install package via make.
|
# Install package via make.
|
||||||
#
|
#
|
||||||
run_rootcmd no ${make_cmd} ${make_install_target} ${make_install_args}
|
run_rootcmd no ${make_cmd} ${make_install_target} ${make_install_args}
|
||||||
if [ "$?" -ne 0 ]; then
|
[ $? -ne 0 ] && msg_error "installing $pkgname-$lver."
|
||||||
msg_error "installing $pkgname-$lver."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Replace libtool archives if requested.
|
# Replace libtool archives if requested.
|
||||||
if [ -z "$in_chroot" ]; then
|
if [ -z "$in_chroot" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user