new: implement pool IGNORE option to mp-pool

This commit is contained in:
ngn 2024-08-22 00:08:56 +03:00
parent 98bb94bec1
commit 7b7b386dab
3 changed files with 28 additions and 9 deletions

View File

@ -75,29 +75,35 @@ if [ ! -d "${distpath}" ]; then
exit 1 exit 1
fi fi
# source and store every package # source and store every package
files=("INFO" "LIST") files=("INFO" "LIST")
pc="$(ls -1q "${srcpath}" | wc -l)" pc="$(ls -1q "${srcpath}" | wc -l)"
pi=1 pi=0
info "Sourcing all the packages" info "Sourcing all the packages"
set_indent set_indent
for pkg in "${srcpath}/"*; do for pkg in "${srcpath}/"*; do
package=$(basename "${pkg}") pkg_name=$(basename "${pkg}")
info "(${pi}/${pc}) Sourcing \"${package}\"" pi=$((pi+1))
if should_ignore "${pkg_name}"; then
info "(${pi}/${pc}) Ignoring \"${pkg_name}\""
continue
fi
info "(${pi}/${pc}) Sourcing \"${pkg_name}\""
source "${pkg}/pkg.sh" source "${pkg}/pkg.sh"
check_ret "(${pi}/${pc}) Failed to import the source script for \"${package}\"" check_ret "(${pi}/${pc}) Failed to import the source script for \"${pkg_name}\""
check_pkg_vars check_pkg_vars
check_ret check_ret
files+=("${NAME}_${VERSION}.mpf") files+=("${NAME}_${VERSION}.mpf")
files+=("${NAME}_${VERSION}.mpf.sig") files+=("${NAME}_${VERSION}.mpf.sig")
clean_pkg_vars clean_pkg_vars
pi=$((pi+1))
done done
success "Completed" success "Completed"

View File

@ -205,16 +205,22 @@ fi
# build every package # build every package
pc=${#OPT_PACKAGES[@]} pc=${#OPT_PACKAGES[@]}
pi=1 pi=0
for pkg_name in "${OPT_PACKAGES[@]}"; do for pkg_name in "${OPT_PACKAGES[@]}"; do
pkg="${srcpath}/${pkg_name}" pkg="${srcpath}/${pkg_name}"
pi=$((pi+1))
if [ ! -d "${pkg}" ]; then if [ ! -d "${pkg}" ]; then
error "Package not found: \"${pkg_name}\"" error "Package not found: \"${pkg_name}\""
exit 1 exit 1
fi fi
if should_ignore "${pkg_name}"; then
info "(${pi}/${pc}) Ignoring \"${pkg_name}\""
continue
fi
info "(${pi}/${pc}) Building \"${pkg_name}\"" info "(${pi}/${pc}) Building \"${pkg_name}\""
if [ $OPT_SKIP_FAIL -eq 1 ]; then if [ $OPT_SKIP_FAIL -eq 1 ]; then
@ -239,7 +245,6 @@ for pkg_name in "${OPT_PACKAGES[@]}"; do
fi fi
success "(${pi}/${pc}) Build was successful for \"${pkg_name}\"" success "(${pi}/${pc}) Build was successful for \"${pkg_name}\""
pi=$((pi+1))
done done
success "Completed all the package builds" success "Completed all the package builds"

View File

@ -230,3 +230,11 @@ check_pkg_vars() {
return 0 return 0
} }
# check if a package should be ignored
should_ignore(){
for i in "${IGNORE[@]}"; do
[ "${i}" == "${1}" ] && return 0
done
return 1
}