Some scripts like to use /usr/bin/env to find the interpreter but this

confuses the dependency extractor. We now detect the use of /usr/bin/env
and just pass that on without the arguments.
This commit is contained in:
Tom G. Christensen 2005-12-29 14:35:54 +00:00
parent 82dcedd482
commit 4bbc8a32d1

View File

@ -1049,9 +1049,13 @@ extract_deps()
interp="$($HEAD -n 1 $f | $CUT -d\! -f2- | $SED -e 's/ -.*//')"
if [ -L "$interp" ]; then
echo $($FILE -h "$interp" | $SED -e 's/.* to //')
else
if [ "$(echo $interp | $CUT -d' ' -f1)" = "/usr/bin/env" ]; then
echo "/usr/bin/env"
else
echo $interp
fi
fi
done | $SORT -u | $XARGS -r $SHOWFILES -- | $AWK '{ print $4 }' | $SORT -u
fi
}