Copy files needed for other files at the very end.

From-SVN: r6067
This commit is contained in:
Richard Stallman 1993-11-11 08:20:12 +00:00
parent fa27d32029
commit 8f8470e01f

View File

@ -337,33 +337,6 @@ while [ $# != 0 ]; do
shift; shift
done
# Make sure that any include files referenced using double quotes
# exist in the fixed directory.
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}
# Install the proper definition of size_t in header files that it comes from.
@ -1376,6 +1349,35 @@ if $LINKS; then
done
fi
# Make sure that any include files referenced using double quotes
# exist in the fixed directory. This comes last since otherwise
# we might end up deleting some of these files "because they don't
# need any change."
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
echo 'Cleaning up DONE files.'
cd $LIB
find . -name DONE -exec rm -f '{}' ';'