This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB 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]

[RFA] Use observer.tmp instead of observer.inc-tmp


File-name clashes on 8+3 filesystems strike again.

Okay to commit?

2005-05-12  Eli Zaretskii  <eliz@gnu.org>

	* observer.sh: Use observer.tmp instead of observer.inc-tmp which
	on 8+3 filesystems overwrites observer.inc.  Update copyright year
	of the resultant file.

Index: observer.sh
===================================================================
RCS file: /cvs/src/src/gdb/observer.sh,v
retrieving revision 1.4
diff -u -r1.4 observer.sh
--- observer.sh	1 Sep 2004 18:00:29 -0000	1.4
+++ observer.sh	12 May 2005 13:40:19 -0000
@@ -8,18 +8,19 @@
 
 lang=$1 ; shift
 texi=$1 ; shift
-o=$1 ; shift
-echo "Creating ${o}-tmp" 1>&2
-rm -f ${o}-tmp
+o=$1
+otmp="`echo $1 | sed -e 's,\.[^.]*$,,'`.tmp"; shift
+echo "Creating ${otmp}" 1>&2
+rm -f ${otmp}
 
 # Can use any of the following: cat cmp cp diff echo egrep expr false
 # grep install-info ln ls mkdir mv pwd rm rmdir sed sleep sort tar
 # test touch true
 
-cat <<EOF >>${o}-tmp
+cat <<EOF >>${otmp}
 /* GDB Notifications to Observers.
 
-   Copyright 2004 Free Software Foundation, Inc.
+   Copyright 2004, 2005 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -46,7 +47,7 @@
 
 
 case $lang in
-    h) cat <<EOF >>${o}-tmp
+    h) cat <<EOF >>${otmp}
 #ifndef OBSERVER_H
 #define OBSERVER_H
 
@@ -87,7 +88,7 @@
 ' $texi | while read event formal actual
 do
   case $lang in
-      h) cat <<EOF >>${o}-tmp
+      h) cat <<EOF >>${otmp}
 
 /* ${event} notifications.  */
 
@@ -100,7 +101,7 @@
 	;;
 
       inc)
-      	cat <<EOF >>${o}-tmp
+      	cat <<EOF >>${otmp}
 
 /* ${event} notifications.  */
 
@@ -146,12 +147,12 @@
 
 
 case $lang in
-    h) cat <<EOF >>${o}-tmp
+    h) cat <<EOF >>${otmp}
 
 #endif /* OBSERVER_H */
 EOF
 esac
 
 
-echo Moving ${o}-tmp to ${o}
-mv ${o}-tmp ${o}
+echo Moving ${otmp} to ${o}
+mv ${otmp} ${o}


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