Skip to content

Commit

Permalink
scripts(test-buildorder-random): skip packages with blacklisted arches
Browse files Browse the repository at this point in the history
  • Loading branch information
truboxl committed Jan 23, 2025
1 parent f28649c commit 2096225
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions scripts/bin/test-buildorder-random
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@ TERMUX_SCRIPTDIR=$(realpath "$(dirname "$0")/../..") # Root of repository.

cd "${TERMUX_SCRIPTDIR}" || exit 1

no_of_packages=0
packages=$(find packages -maxdepth 1 -type d | sort)
[ -n "$packages" ] && no_of_packages=$(echo "${packages}" | wc -l)
random_package_no=$(shuf -i 1-"${no_of_packages}" -n 1)
random_package=$(echo "${packages}" | head -n"${random_package_no}" | tail -n1)
no_of_total_packages=0
no_of_filter_pacakges=0

total_packages=$(find packages -maxdepth 1 -type d | sort)
filter_packages=$(find packages -maxdepth 2 -type f -name build.sh | xargs -P$(nproc) -i sh -c "if ! grep -E "^TERMUX_PKG_BLACKLISTED_ARCHES=.*${TERMUX_ARCH}" {} >/dev/null; then dirname {}; fi" | sort)

[ -n "${total_packages}" ] && no_of_total_packages=$(echo "${total_packages}" | wc -l)
[ -n "${filter_packages}" ] && no_of_filter_packages=$(echo "${filter_packages}" | wc -l)
echo "INFO: Filtered packages: ${no_of_filter_packages} of ${no_of_total_packages}"

random_package_no=$(shuf -i 1-"${no_of_filter_packages}" -n 1)
random_package=$(echo "${filter_packages}" | head -n"${random_package_no}" | tail -n1)
echo "INFO: random_package = ${random_package}"
./scripts/buildorder.py "${random_package}"

0 comments on commit 2096225

Please sign in to comment.