xbps-src: improve msg_* funcs and update all callers.

This commit is contained in:
Juan RP 2010-12-20 00:22:12 +01:00
parent 24c7ac6808
commit 3da3783333
27 changed files with 184 additions and 173 deletions

View file

@ -149,26 +149,26 @@ check_config_vars()
break
fi
done
[ -z "$cffound" ] && msg_error "cannot find a config file"
[ -z "$cffound" ] && msg_error "cannot find a config file\n"
fi
run_file ${XBPS_CONFIG_FILE}
export XBPS_CONFIG_FILE=$path_fixed
if [ ! -f "$XBPS_CONFIG_FILE" ]; then
msg_error "cannot find configuration file: $XBPS_CONFIG_FILE"
msg_error "cannot find configuration file: $XBPS_CONFIG_FILE\n"
fi
for f in XBPS_DISTRIBUTIONDIR XBPS_MASTERDIR; do
eval val="\$${f}"
if [ -z "$val" ]; then
msg_error "'${f}' not set in configuration file!"
msg_error "'${f}' not set in configuration file!\n"
fi
done
if [ ! -d "$XBPS_MASTERDIR" ]; then
mkdir -p "$val"
if [ $? -ne 0 ]; then
msg_error "couldn't create 'XBPS_MASTERDIR' directory"
msg_error "couldn't create 'XBPS_MASTERDIR' directory\n"
fi
fi
[ -z "${_MASTERDIR_FLAG}" ] && export _MASTERDIR="$XBPS_MASTERDIR"
@ -274,13 +274,13 @@ bootstrap)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
. $XBPS_SHUTILSDIR/pkgtarget_funcs.sh
[ ! -d $XBPS_SRCPKGDIR/xbps-base-chroot ] && \
msg_error "Cannot find $XBPS_SRCPKGDIR/xbps-base-chroot directory!"
msg_error "Cannot find $XBPS_SRCPKGDIR/xbps-base-chroot directory!\n"
cd $XBPS_SRCPKGDIR/xbps-base-chroot && _ORIGINPKG="$(basename_cwd)"
setup_tmpl ${_ORIGINPKG} && install_pkg $pkgname
;;
build|configure)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
. ./template
if [ -z "$base_chroot" -a -z "$in_chroot" ]; then
@ -294,7 +294,7 @@ build|configure)
. $XBPS_SHUTILSDIR/builddep_funcs.sh
install_dependencies_pkg "$pkgname-$version"
if [ $? -ne 0 ]; then
msg_red "cannot install required deps for $pkgname."
msg_red "cannot install required deps for $pkgname.\n"
exit 1
fi
# All deps were installed, continue with the origin pkg...
@ -333,7 +333,7 @@ build-pkg)
fi
done
else
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
xbps_make_binpkg
fi
@ -349,13 +349,13 @@ chroot)
;;
clean)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
remove_tmpl_wrksrc $wrksrc
;;
extract|fetch|info)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
if [ "$target" = "info" ]; then
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
@ -372,7 +372,7 @@ extract|fetch|info)
;;
install|install-destdir)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
. ./template
install_destdir_target=no
@ -407,21 +407,21 @@ make-repoidx)
;;
remove)
. $XBPS_SHUTILSDIR/pkgtarget_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
remove_pkg
;;
stow)
stow_flag=yes
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
. $XBPS_SHUTILSDIR/stow_funcs.sh
stow_pkg_handler stow
;;
unstow)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
[ ! -r ./template ] && msg_error "missing build template in $(pwd)."
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
setup_tmpl $(basename_cwd)
. $XBPS_SHUTILSDIR/stow_funcs.sh
stow_pkg_handler unstow