build: move install dirs out of the build dir

Instead of cluttering $BUILD we now have
- $BUILD/build         sources and builds of packages
- $BUILD/install_pkg   installed packages
- $BUILD/install_init  installed packages for initramfs
This commit is contained in:
Andre Heider 2019-11-30 12:31:03 +01:00
parent 61af0490ef
commit 8e4663912a
4 changed files with 14 additions and 8 deletions

View File

@ -792,7 +792,7 @@ get_pkg_variable() {
get_build_dir() {
local _PKG_NAME="${1%:*}" _PKG_VERSION="$(get_pkg_version "$1")"
if [ -n "$_PKG_NAME" -a -n "$_PKG_VERSION" ]; then
echo $BUILD/${_PKG_NAME}-${_PKG_VERSION}
echo $BUILD/build/${_PKG_NAME}-${_PKG_VERSION}
fi
}
@ -1030,12 +1030,12 @@ source_package() {
fi
fi
PKG_BUILD="$BUILD/${PKG_NAME}-${PKG_VERSION}"
PKG_BUILD="$BUILD/build/${PKG_NAME}-${PKG_VERSION}"
if [[ "${1}" =~ :target$ || "${1//:/}" = "${1}" ]]; then
PKG_INSTALL="${PKG_BUILD}/.install_pkg"
PKG_INSTALL="$BUILD/install_pkg/${PKG_NAME}-${PKG_VERSION}"
elif [[ "${1}" =~ :init$ ]]; then
PKG_INSTALL="${PKG_BUILD}/.install_init"
PKG_INSTALL="$BUILD/install_init/${PKG_NAME}-${PKG_VERSION}"
fi
fi

View File

@ -485,6 +485,10 @@ if [ "${TARGET}" = "target" -o "${TARGET}" = "init" ]; then
fi
fi
if [ -n "${INSTALL}" -a -d "${INSTALL}" ]; then
echo "INFO_PKG_NAME=\"${PKG_NAME}\"" > "${INSTALL}/.libreelec-package"
fi
cd ${ROOT}
PKG_DEEPHASH=$(calculate_stamp)

View File

@ -14,8 +14,10 @@ clean_package() {
return
fi
# Use a wilcard here to remove all versions of the package
for i in "${BUILD}/${1}-"*; do
# Use a wildcard here to remove all versions of the package
for i in "${BUILD}/build/${1}-"* \
"${BUILD}/install_pkg/${1}-"* \
"${BUILD}/install_init/${1}-"*; do
if [ -d "${i}" -a -f "${i}/.libreelec-unpack" ]; then
. "${i}/.libreelec-unpack"
if [ "${STAMP_PKG_NAME}" = "${1}" ]; then

View File

@ -27,11 +27,11 @@ fi
STAMP="${PKG_BUILD}/.libreelec-unpack"
mkdir -p ${BUILD}
mkdir -p ${BUILD}/build
# Perform a wildcard match on the package to ensure old versions are cleaned too
PKG_DEEPHASH=
for i in ${BUILD}/${PKG_NAME}-*; do
for i in ${BUILD}/build/${PKG_NAME}-*; do
if [ -d ${i} -a -f "${i}/.libreelec-unpack" ] ; then
. "${i}/.libreelec-unpack"
if [ "${STAMP_PKG_NAME}" = "${PKG_NAME}" ]; then