Skip to content

Commit

Permalink
beesh: first run beefile, then check for completeness
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Jul 5, 2016
1 parent 9c3c227 commit 6becbc0
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions src/beesh.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function check_repositories() {
}

function build_in_sourcedir() {
B=${S}
BUILD_IN_SOURCEDIR=1
}

function add_sourcesubdir() {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6becbc0

Please sign in to comment.