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 ...@@ -339,20 +339,29 @@ done
# Make sure that any include files referenced using double quotes # Make sure that any include files referenced using double quotes
# exist in the fixed directory. # exist in the fixed directory.
set x $required while [ -n "$required" ]; do
shift newreq=
while [ $# != 0 ]; do set x $required
# $1 is the directory to copy from, $2 is the unfixed file, shift
# $3 is the fixed file name. while [ $# != 0 ]; do
cd ${INPUT} # $1 is the directory to copy from, $2 is the unfixed file,
cd $1 # $3 is the fixed file name.
if [ -r $2 ] && [ ! -r $3 ]; then cd ${INPUT}
cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" cd $1
chmod +w $3 2>/dev/null if [ -r $2 ] && [ ! -r $3 ]; then
chmod a+r $3 2>/dev/null cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2"
echo Copied $2 chmod +w $3 2>/dev/null
fi chmod a+r $3 2>/dev/null
shift; shift; shift 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 done
cd ${INPUT} 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