Commit b1533c05 by Richard Stallman

(loop on $required): When a file is copied

because another file needs it, scan it for what files it needs.

From-SVN: r6045
parent 2878315f
......@@ -339,20 +339,29 @@ done
# Make sure that any include files referenced using double quotes
# exist in the fixed directory.
set x $required
shift
while [ $# != 0 ]; do
# $1 is the directory to copy from, $2 is the unfixed file,
# $3 is the fixed file name.
cd ${INPUT}
cd $1
if [ -r $2 ] && [ ! -r $3 ]; then
cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2"
chmod +w $3 2>/dev/null
chmod a+r $3 2>/dev/null
echo Copied $2
fi
shift; shift; shift
while [ -n "$required" ]; do
newreq=
set x $required
shift
while [ $# != 0 ]; do
# $1 is the directory to copy from, $2 is the unfixed file,
# $3 is the fixed file name.
cd ${INPUT}
cd $1
if [ -r $2 ] && [ ! -r $3 ]; then
cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2"
chmod +w $3 2>/dev/null
chmod a+r $3 2>/dev/null
echo Copied $2
for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 | sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`; do
dir=`echo $2 | sed -e s'|/[^/]*$||'`
dir2=`echo $3 | sed -e s'|/[^/]*$||'`
newreq="$newreq $1 $dir/$include $dir2/$include"
done
fi
shift; shift; shift
done
required=$newreq
done
cd ${INPUT}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment