4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-25 16:47:20 +08:00
Corinna Vinschen d45261f62a Cygwin: replace all fgrep' with grep -F'
Unfortunately fgrep is now deprecated in a very pushy way.
Make sure to use grep -F instead all around, even in docs
and comments/

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-01-18 10:53:25 +01:00

36 lines
898 B
Bash
Executable File

#!/bin/sh
if [ "$1" = "-r" ]
then
# We're being called recursively by another xidepend instance, so
# suppress outputs that only happen at the top level.
shift
subproc=1
else
subproc=0
fi
for f in "$@"
do
f=`basename "$f"`
if grep -F -q 'xi:include' "$f"
then
# This file uses XIncludes. Let's chase its deps recursively.
base=`basename "$f" .xml`
if [ $subproc -eq 0 ] ; then echo -n "${base}_SOURCES=${f}" ; fi
deps=`grep 'xi:include.*href' "$f" | cut -f2 -d\" | tr '\n' ' '`
echo -n " $deps"
for d in $deps
do
# Call ourselves recursively to continue to collect deps.
# The -r flag tells our subprocess that it is merely
# contributing to a dependency line in progress.
$0 -r $d
done
# If we're at the top recursion level, we have nothing else to
# add to this dependency line other than the newline.
if [ $subproc -eq 0 ] ; then echo ; fi
fi
done