buildsystem: build/unpack - simplify some logic

This commit is contained in:
MilhouseVH 2019-06-16 02:56:30 +01:00
parent cd71230bdb
commit f9a2623d06
2 changed files with 9 additions and 10 deletions

View File

@ -43,15 +43,14 @@ STAMP=${STAMPS}/${PKG_NAME}/build_${TARGET}
if [ -f ${STAMP} ]; then if [ -f ${STAMP} ]; then
. ${STAMP} . ${STAMP}
PKG_DEEPHASH=$(calculate_stamp) PKG_DEEPHASH=$(calculate_stamp)
if [ ! "${PKG_DEEPHASH}" = "${STAMP_PKG_DEEPHASH}" ]; then
rm -f ${STAMP} if [ "${PKG_DEEPHASH}" = "${STAMP_PKG_DEEPHASH}" -a "${BUILD_WITH_DEBUG}" = "${STAMP_BUILD_WITH_DEBUG}" ]; then
elif [ ! "${BUILD_WITH_DEBUG}" = "${STAMP_BUILD_WITH_DEBUG}" ]; then
rm -f ${STAMP}
else
# stamp matched: already built, do nothing # stamp matched: already built, do nothing
pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "already built" pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "already built"
exit 0 exit 0
fi fi
rm -f ${STAMP}
fi fi
if [ -n "${PKG_DEPENDS_UNPACK}" ]; then if [ -n "${PKG_DEPENDS_UNPACK}" ]; then
@ -216,9 +215,7 @@ pkg_lock_status "ACTIVE" "${PKG_NAME}:${TARGET}" "build"
pkg_call_exists pre_build_${TARGET} && pkg_call pre_build_${TARGET} pkg_call_exists pre_build_${TARGET} && pkg_call pre_build_${TARGET}
# ensure ${PKG_BUILD} is there. (installer? PKG_URL="") # ensure ${PKG_BUILD} is there. (installer? PKG_URL="")
if [ ! -d "${PKG_BUILD}" ] ; then mkdir -p "${PKG_BUILD}"
mkdir -p "${PKG_BUILD}"
fi
cd "${PKG_BUILD}" cd "${PKG_BUILD}"

View File

@ -36,8 +36,10 @@ PARENT_PKG="${2:-${PKG_NAME}:${TARGET}}"
pkg_lock "${PKG_NAME}:${TARGET}" "install" "${PARENT_PKG}" pkg_lock "${PKG_NAME}:${TARGET}" "install" "${PARENT_PKG}"
STAMP=${STAMPS_INSTALL}/${PKG_NAME}/install_${TARGET} STAMP=${STAMPS_INSTALL}/${PKG_NAME}/install_${TARGET}
[ -f ${STAMP} ] && pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "install" "already installed" if [ -f ${STAMP} ]; then
[ -f ${STAMP} ] && exit 0 pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "install" "already installed"
exit 0
fi
mkdir -p ${STAMPS_INSTALL}/${PKG_NAME} mkdir -p ${STAMPS_INSTALL}/${PKG_NAME}