#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv) . ./config/options "" MD5SUM="$(echo ${BUILD} | md5sum | awk '{ print $1 }')" RESTART_FILE=/tmp/checkunpack.progress.${MD5SUM} usage() { cat <&2 for pkg_name in $(get_all_package_names | grep -E "${FILTER}"); do stamp=$(source_package ${pkg_name}; calculate_stamp) if [ -z "${stamp}" ]; then [ "${SHOW_SKIPPED}" = "yes" ] && printf "Checking: %-40s IGNORED\n" "${pkg_name}" continue fi if [ "${USING_FILTER}" = "no" ] && grep -qE "^${pkg_name} ${stamp}$" ${RESTART_FILE} 2>/dev/null; then [ "${SHOW_SKIPPED}" = "yes" ] && printf "Checking: %-40s SKIPPED\n" "${pkg_name}" continue fi printf "Checking: %-40s" "${pkg_name}" rm -rf "${BUILD}/"* ${BUILD}/.unpack OUTPUT="$(scripts/unpack "${pkg_name}" 2>&1)" && res=0 || res=1 if [ ${res} -eq 0 ]; then echo " ${TXGREEN}OK${TXRESET}" [ "${USING_FILTER}" = "no" ] && echo "${pkg_name} ${stamp}" >>${RESTART_FILE} else echo " ${TXRED}FAILED${TXRESET}" echo "${pkg_name}" >>${TMP_FILE} [ "${VERBOSE}" = "yes" -a -n "${OUTPUT}" ] && echo "${OUTPUT}" fi rm -rf "${BUILD}/"* ${BUILD}/.unpack done if [ -s "${TMP_FILE}" ]; then echo echo "The following packages failed to unpack:" cat ${TMP_FILE} exit 1 fi