commit: ce97c50a2494a46b30f69ee6371f65e37fc2f5a1
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Sun Jun 8 15:06:21 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 9 02:51:07 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ce97c50a
isolated-functions.sh: have find0() support the {H,L,P} opts in backward-compat
mode
GNU find(1) supports several options, the most important of which are
-H, -L and -P. The find0() function presently implements a fallback
mode, the purpose of which is to retain compatibility with the outdated
GitHub CI environment (which has an older version of findutils).
However, the fallback mode is currently unable to handle the
aforementioned options correctly. Render it able to do so by recognising
where they are present and ensuring that they precede both pathnames and
primaries alike. This may prove useful in the future.
See-also: a0210b3c49ea346b1e999f92a7ed89802e8d6849
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/isolated-functions.sh | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 1befb4a91f..874c6c8eea 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -704,10 +704,16 @@ find0() {
# This is a temporary workaround for the GitHub CI runner, which
# suffers from an outdated version of findutils, per bug 957550.
find0() {
- local -a paths
+ local -a opts paths
+ # All of -H, -L and -P are options. If specified, they
+ # must precede pathnames and primaries alike.
+ while [[ $1 == -[HLP] ]]; do
+ opts+=("$1")
+ shift
+ done
mapfile -td '' paths
- find "${paths[@]}" "$@"
+ find "${opts[@]}" "${paths[@]}" "$@"
}
fi