This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix problem with gcc_update not being writable when it isbeing executed on Cygwin


Hi,
this small patch works around problem of gcc_update not being writable when
it is being executed. What it does is that it makes gcc_update update itself
before the rest of the tree and then re-execute itself.

VH


2004-08-29  Vaclav Haisman <v.haisman@sh.cvut.cz>

	* gcc_update: Fix gcc_update not being writable on Cygwin when
	gcc_update is being executed.
	(update_tree): New function. Move tree update functionality here.
	(--update): New switch whose functionality is in update_tree().

Index: contrib/gcc_update
===================================================================
RCS file: /cvs/gcc/gcc/contrib/gcc_update,v
retrieving revision 1.75
diff -c -p -r1.75 gcc_update
*** contrib/gcc_update	25 Aug 2004 09:07:43 -0000	1.75
--- contrib/gcc_update	29 Aug 2004 15:40:44 -0000
*************** touch_files_reexec () {
*** 140,145 ****
--- 140,146 ----
      exec ${CONFIG_SHELL-/bin/sh} $self --touch
  }

+
  # This functions applies a patch to an existing tree.
  apply_patch () {
      if [ -f $1 ]; then
*************** apply_patch () {
*** 156,161 ****
--- 157,194 ----
      touch_files_reexec
  }

+
+ # This functions does ordinary update of an existing tree.
+ update_tree () {
+     # Check whether this indeed looks like a local CVS tree.
+     if [ ! -d CVS ]; then
+         echo "This does not seem to be a GCC CVS tree!"
+         exit
+     fi
+
+     # Check command-line options
+     if [ x"${1}"x = x"--nostdflags"x ]; then
+         shift
+     else
+         set -- $UPDATE_OPTIONS ${1+"$@"}
+     fi
+
+     echo "Updating CVS tree"
+     $GCC_CVS -q update ${1+"$@"}
+     if [ $? -ne 0 ]; then
+         (touch_files_reexec)
+         echo "CVS update of full tree failed." >&2
+         exit 1
+     fi
+
+     {
+       date
+       TZ=UTC date
+     } > LAST_UPDATED
+     touch_files_reexec
+ }
+
+
  # Check whether this indeed looks like a local tree.
  if [ ! -f gcc/version.c ]; then
      echo "This does not seem to be a GCC tree!"
*************** p
*** 201,231 ****
      exit $?
      ;;

! esac
!
! # Check whether this indeed looks like a local CVS tree.
! if [ ! -d CVS ]; then
!     echo "This does not seem to be a GCC CVS tree!"
!     exit
! fi
!
! # Check command-line options
! if [ x"${1}"x = x"--nostdflags"x ]; then
      shift
! else
!     set -- $UPDATE_OPTIONS ${1+"$@"}
! fi

! echo "Updating CVS tree"
! $GCC_CVS -q update ${1+"$@"}
! if [ $? -ne 0 ]; then
!     (touch_files_reexec)
!     echo "CVS update of full tree failed." >&2
!     exit 1
! fi

! {
!   date
!   TZ=UTC date
! } > LAST_UPDATED
! touch_files_reexec
--- 234,250 ----
      exit $?
      ;;

! --update)
      shift
!     update_tree
!     exit $?
!     ;;

! esac

! # No switches means plain update.
! exec ${SHELL} -s <<EOF
!     echo "Updating contrib/gcc_update first"
!     ${GCC_CVS} update ${UPDATE_OPTIONS} contrib/gcc_update
!     exec ${self} --update $*
! EOF


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]