From 84e99ce105665a8a47d95e92df7f2075ada5c000 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Thu, 23 Jun 2016 22:47:03 +0200 Subject: [PATCH] beesh: first run beefile, then check for completeness we allow the bee file to be started without a complete version set. the bee file should set the version with a callback we add in a following patch. When we allow the version to be set in the bee file, $B and $S, which depend on the full package name, can only be set after the bee file is run. So we need to postpone the effect of the build_in_sourcedir callback to a later time. The beefiles can also set $B=$S directly. We deprecate this with this patch, but still detect it and act accordinly. --- src/beesh.sh.in | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/src/beesh.sh.in b/src/beesh.sh.in index 2e746f3..1e4656b 100644 --- a/src/beesh.sh.in +++ b/src/beesh.sh.in @@ -192,7 +192,7 @@ function check_repositories() { } function build_in_sourcedir() { - B=${S} + BUILD_IN_SOURCEDIR=1 } function add_sourcesubdir() { @@ -946,34 +946,46 @@ PKGREVISION= eval $("${BEE_BINDIR}/beeversion" "${BEE}") -if [ -z "${PKGNAME}" -o -z "${PKGVERSION}" -o -z "${PKGREVISION}" ] ; then - print_error "${BEE}: please use the proper package versioning (e.g. package-1.0-0)" - exit 1 -fi - -BEEPKGROOT="${BEE_TMP_BUILDROOT}/${PKGNAME}" -BEEWORKDIR="${BEEPKGROOT}/${PKGFULLPKG}" - -F=${BEEPKGROOT}/files -S=${BEEWORKDIR}/source -B=${BEEWORKDIR}/build -D=${BEEWORKDIR}/image - ############################################################################### # clear PKGALLPKG since we can't trust PKGARCH in this state PKGALLPKG= +S='S_NOT_YET_DEFINED' save_current_package_variables # source file.bee . "${BEE}" +if [ "$B" = 'S_NOT_YET_DEFINED' ] ; then + print_warning "${BEE}: setting \$B=\"\$S\" is deprecated. use build_in_sourcedir instead." + build_in_sourcedir +fi + # now set PKGARCH if set or changed by user via ARCH=.. and not given via file.arch.bee : ${PKGARCH:=${ARCH}} extract_new_package_variables +if [ -z "${PKGNAME}" -o -z "${PKGVERSION}" -o -z "${PKGREVISION}" ] ; then + print_error "${BEE}: please use the proper package versioning (e.g. package-1.0-0)" + exit 1 +fi + +BEEPKGROOT="${BEE_TMP_BUILDROOT}/${PKGNAME}" +BEEWORKDIR="${BEEPKGROOT}/${PKGFULLPKG}" + +F=${BEEPKGROOT}/files +S=${BEEWORKDIR}/source +B=${BEEWORKDIR}/build +D=${BEEWORKDIR}/image + +if [ "$BUILD_IN_SOURCEDIR" ] ; then + print_info "BUILD_IN_SOURCEDIR requested" + B="$S" +fi + + config_handle_deprecated_beefile expand_prefix_variables config_export