diff --git a/config/functions b/config/functions index 631ee2cf0a..b00e535ab0 100644 --- a/config/functions +++ b/config/functions @@ -150,6 +150,33 @@ build_msg() { fi } +print_qa_checks() { + if [ -n "${PKG_NAME}" ]; then + if [ -d "${PKG_QA_CHECKS}" ]; then + for qa_check in ${PKG_QA_CHECKS}/*; do + print_color CLR_WARNING "[QA CHECK] [${PKG_NAME}] [$(basename ${qa_check})]:\n$(cat ${qa_check})\n\n" + done + fi + fi +} + +log_qa_check() { + local qa_check_title="${1}" + local qa_check_message="${2}" + + if [ -n "${qa_check_title}" -a -n "${qa_check_message}" ]; then + if [ -n "${PKG_NAME}" ]; then + print_color CLR_WARNING "[QA CHECK] [${PKG_NAME}] [${qa_check_title}]:\n${qa_check_message}\n" + mkdir -p "${PKG_QA_CHECKS}" + echo -e "${qa_check_message}" >> ${PKG_QA_CHECKS}/${qa_check_title} + else + print_color CLR_WARNING "[QA CHECK] [general] [${qa_check_title}]:\n${qa_check_message}\n" + mkdir -p "${BUILD}/qa_checks/general" + echo -e "${qa_check_message}" >> ${BUILD}/qa_checks/general/${qa_check_title} + fi + fi +} + # prints a warning if the file slated for removal doesn't exist # this allows us to continue instead of bailing out with just "rm" safe_remove() { @@ -1256,6 +1283,8 @@ source_package() { elif [[ "${1}" =~ :init$ ]]; then PKG_INSTALL="$BUILD/install_init/${PKG_NAME}-${PKG_VERSION}" fi + + PKG_QA_CHECKS="${BUILD}/qa_checks/${PKG_NAME}-${PKG_VERSION}" fi build_with_debug && BUILD_WITH_DEBUG="yes" || BUILD_WITH_DEBUG="no" diff --git a/scripts/clean b/scripts/clean index 12d2335062..de9a62941b 100755 --- a/scripts/clean +++ b/scripts/clean @@ -33,6 +33,12 @@ clean_package() { fi fi done + + for i in "${BUILD}/qa_checks/${1}-"*; do + build_msg "CLR_WARNING" "*" "$(print_color "CLR_WARNING_DIM" "Removing ${i} ...")" + rm -rf "${i}" + done + rm -f "${STAMPS}/${1}/build_"* } diff --git a/scripts/image b/scripts/image index f4e54394e6..a90d97f5e8 100755 --- a/scripts/image +++ b/scripts/image @@ -123,6 +123,7 @@ chmod +x ${FAKEROOT_SCRIPT} # make ${FAKEROOT_SCRIPT} executable echo "chown -R 0:0 ${INSTALL}" >> ${FAKEROOT_SCRIPT} # Clean old install dirs +rm -rf ${BUILD}/qa_checks/general rm -rf ${INSTALL} rm -rf ${STAMPS_INSTALL} mkdir -p ${INSTALL} @@ -475,3 +476,8 @@ if [ "${1}" = "release" -o "${1}" = "mkimage" -o "${1}" = "noobs" ]; then rm -rf ${RELEASE_DIR} fi fi + +if [ -d "${BUILD}/qa_checks" -a -n "$(ls -1 ${BUILD}/qa_checks/)" ]; then + log_qa_check "qa_issues" "QA issues present, please fix!\n$(find ${BUILD}/qa_checks/* -type f ! -name qa_issues)\n" +fi + diff --git a/scripts/install b/scripts/install index fcc3dcf9b1..0a92c55571 100755 --- a/scripts/install +++ b/scripts/install @@ -64,6 +64,8 @@ pkg_lock_status "ACTIVE" "${PKG_NAME}:${TARGET}" "install" build_msg "CLR_INSTALL" "INSTALL" "${PKG_NAME} $(print_color CLR_TARGET "(${TARGET})")" "indent" +print_qa_checks + acquire_update_lock image mkdir -p ${INSTALL}