Ignore:
Timestamp:
04/21/2023 08:49:40 AM (17 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
ablfs-more, trunk
Children:
4ba94ad
Parents:
72711ab
Message:

Fix "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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/libs/func_dependencies

    r72711ab r78d04f3  
    523523# We do not need otherlink anymore so just destroy the last element
    524524        unset otherlink[-1]
    525         parentNode=$(grep ^"${otherlink[*]}"\$ -l *)
     525# We cannot use grep -l, because we need to restrict to the first line,
     526# since the prio line may match
     527        for f in *.tree; do
     528          if head -n1 $f | grep -q ^"${otherlink[*]}"\$; then
     529             parentNode=$f; break
     530          fi
     531        done
    526532        return $p2
    527533      fi
Note: See TracChangeset for help on using the changeset viewer.