gcc_update: watch empty files

Alfred Minarik alfred.minarik@lion.cc
Wed Mar 28 01:13:00 GMT 2001


Alexandre Oliva wrote:

> Part of me says it should be a separate script, since
> contrib/gcc_update is mainly used for CVS.  But I'd like to take a
> second opinion.

I actually like it to be a central tool for cvs, patches, diffs, and general
consistency timestamps. I only miss some mention in install docs.
Something like this:

*** wwwdocs_old/htdocs/install/download.html       Wed Mar 28 10:07:00 2001
--- wwwdocs_new/htdocs/install/download.html       Wed Mar 28 10:33:58 2001
***************
*** 27,32 ****
--- 27,39 ----
  <p>Unpack the core distribution as well as any language specific
  distributions in the same directory.</p>
 
+ <p>If you choose to use diff files and patch to update
+ to the current distribution, it is recommended that you
+ also use the gcc_update script to keep
+ consistent timestamps and missing empty files.
+ Just enter the main directory of the distribution and
+ issue the command `<code>./contrib/gcc_update  --touch</code>'.</p>
+
  <P>If you also intend to build binutils (either to upgrade an existing
  installation or for use in place of the corresponding tools of your
  OS), unpack the binutils distribution either in the same directory or

> Use test -f; test -e is not portable.

Thanks, this will work alike. For convenience patch again with this:


2001-03-28  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 [ ! -f $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



More information about the Gcc-patches mailing list