diff options
author | Warren Young <warren@etr-usa.com> | 2013-05-23 19:02:46 +0000 |
---|---|---|
committer | Warren Young <warren@etr-usa.com> | 2013-05-23 19:02:46 +0000 |
commit | 42d724c92a93d5b115fd4add896d712f6dbb5d35 (patch) | |
tree | 73f76dfe187119feaec9195aec494634189812af /winsup/doc/xidepend | |
parent | cc88e009edc0ac57241551c8bff2ee21269a2fb6 (diff) | |
download | cygnal-42d724c92a93d5b115fd4add896d712f6dbb5d35.tar.gz cygnal-42d724c92a93d5b115fd4add896d712f6dbb5d35.tar.bz2 cygnal-42d724c92a93d5b115fd4add896d712f6dbb5d35.zip |
Created xidepend mechanism
Diffstat (limited to 'winsup/doc/xidepend')
-rwxr-xr-x | winsup/doc/xidepend | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/winsup/doc/xidepend b/winsup/doc/xidepend new file mode 100755 index 000000000..0704a7f28 --- /dev/null +++ b/winsup/doc/xidepend @@ -0,0 +1,34 @@ +#!/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 + if fgrep -q 'xi:include' "$f" + then + # This file uses XIncludes. Let's chase its deps recursively. + base=`echo $f | sed -e s/\.xml//` + if [ $subproc -eq 0 ] ; then echo -n "$base/$base.html:" ; 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 |