jhalfs git · trunk
jhalfs LFS build automation (mirror)
Python 78.4% Shell 19.8% Makefile 1.8%git clone https://git.christianimmanuel.de/mirrors-forks/jhalfs.gitwget https://git.christianimmanuel.de/mirrors-forks/jhalfs/archive/jhalfs.tar.gzFix "ambiguous redirect" in func_dependencies
We use grep -l ^"${otherlink[*]"\$ to find parentNode, since the
parentNode is the only file with a link line that matches. Problem
is that sometimes the priority line may match too. This makes a
parentNode variable containing several lines, and when redirecting
to $parentNode, creates those "ambiguous redirect" messages.
Fix: use a loop, and only grep on the first line of each file.BLFS/libs/func_dependencies | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BLFS/libs/func_dependencies b/BLFS/libs/func_dependencies index b2c082d..673d9f8 100644 --- a/BLFS/libs/func_dependencies +++ b/BLFS/libs/func_dependencies @@ -522,7 +522,13 @@ while read prio_of_dep build_of_dep id_of_dep; do # The parent has the same link without the last entry. # We do not need otherlink anymore so just destroy the last element unset otherlink[-1] - parentNode=$(grep ^"${otherlink[*]}"\$ -l *) +# We cannot use grep -l, because we need to restrict to the first line, +# since the prio line may match + for f in *.tree; do + if head -n1 $f | grep -q ^"${otherlink[*]}"\$; then + parentNode=$f; break + fi + done return $p2 fi else # not circular: prune tree (but not .dep, since it may happen that