This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
gcc_update: watch empty files
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Subject: gcc_update: watch empty files
- From: Alfred Minarik <alfred dot minarik at lion dot cc>
- Date: Wed, 21 Mar 2001 13:59:03 +0100
There are quite some empty files in the gcc repository. At least some
of them useful (like in the libstdc++-v3 testsuite). No problem if
you use CVS, but one if you use "diff -N" and "patch -E". So every
time using the new snapshot patches new empty files will miss.
And it will be the same when one day there will be a 2.95.3 to 3.0 patch.
So I propose this for trunk and branch.
The distributed .brik file holds all the information we need.
contrib/gcc_update should use it.
A very minor problem, but it annoyed me.
2001-03-21 Alfred Minarik <alfred.minarik@lion.cc>
* gcc_update: Touch missing empty files
*** gcc_old/contrib/gcc_update Wed Mar 21 10:19:08 2001
--- gcc_new/contrib/gcc_update Wed Mar 21 12:51:05 2001
***************
*** 14,20 ****
#
# If the first parameter is --touch, no cvs operation will be performed,
# only generated files that appear to be out of date in the local tree
! # will be touched.
#
# If the first parameter is --list, a list of the generated files and
# their dependencies will be printed; --help prints this message.
--- 14,20 ----
#
# If the first parameter is --touch, no cvs operation will be performed,
# only generated files that appear to be out of date in the local tree
! # will be touched and missing empty files will be generated.
#
# If the first parameter is --list, a list of the generated files and
# their dependencies will be printed; --help prints this message.
***************
*** 104,113 ****
test `ls -1dt ${1+"$@"} | sed 1q` != "$1"
}
! # This function touches generated files such that the ``end'' user does
# not have to rebuild them.
touch_files () {
files_and_dependencies | while read f deps; do
if test -f $f && is_out_of_date "$f" $deps; then
echo Touching "$f"...
--- 104,125 ----
test `ls -1dt ${1+"$@"} | sed 1q` != "$1"
}
+ # search for empty files scanning .brik
+ empty_files () {
+ if test -f .brik; then
+ sed -e '/4294967295b/! d' -e 's/4294967295b *//' .brik
+ fi
+ }
! # This function rebuilds empty files (lost by diff and patch)
! # and touches generated files such that the ``end'' user does
# not have to rebuild them.
touch_files () {
+ empty_files | while read f; do
+ if [ ! -e $f ]; then
+ touch $f 2>/dev/null && echo Creating empty file $f
+ fi
+ done
files_and_dependencies | while read f deps; do
if test -f $f && is_out_of_date "$f" $deps; then
echo Touching "$f"...
Alfred