Don't make generated files read-only. That would bother too many
authorJim Meyering <jim@meyering.net>
Fri, 8 Sep 2006 12:26:34 +0000 (12:26 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 8 Sep 2006 12:26:34 +0000 (12:26 +0000)
people.  However, do retain the ability to work when targets are
read-only: remove the destination and temporary files before writing
them (when generated via sed or echo), or by using the -f option for
both cp and mv commands.  Suggestion to use -f from Paul Eggert.
* modules/alloca-opt, modules/argz, modules/arpa_inet:
* modules/byteswap, modules/configmake, modules/fcntl:
* modules/fnmatch, modules/getopt, modules/glob, modules/inttypes:
* modules/localcharset, modules/netinet_in, modules/poll:
* modules/stdbool, modules/stdint, modules/sys_select:
* modules/sys_socket, modules/sys_stat, modules/sysexits:

20 files changed:
ChangeLog
modules/alloca-opt
modules/argz
modules/arpa_inet
modules/byteswap
modules/configmake
modules/fcntl
modules/fnmatch
modules/getopt
modules/glob
modules/inttypes
modules/localcharset
modules/netinet_in
modules/poll
modules/stdbool
modules/stdint
modules/sys_select
modules/sys_socket
modules/sys_stat
modules/sysexits

index f83474518d1cc8078a0e369b9e1aaa63181eec56..2ddf4cdce6ae5a3938261f8821bbc065799ede04 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2006-09-08  Jim Meyering  <jim@meyering.net>
+
+       Don't make generated files read-only.  That would bother too many
+       people.  However, do retain the ability to work when targets are
+       read-only: remove the destination and temporary files before writing
+       them (when generated via sed or echo), or by using the -f option for
+       both cp and mv commands.  Suggestion to use -f from Paul Eggert.
+       * modules/alloca-opt, modules/argz, modules/arpa_inet:
+       * modules/byteswap, modules/configmake, modules/fcntl:
+       * modules/fnmatch, modules/getopt, modules/glob, modules/inttypes:
+       * modules/localcharset, modules/netinet_in, modules/poll:
+       * modules/stdbool, modules/stdint, modules/sys_select:
+       * modules/sys_socket, modules/sys_stat, modules/sysexits:
+
 2006-09-07  Jim Meyering  <jim@meyering.net>
 
        Fix global typo in last change: use chmod u-w, not chmod u-x.
index f2cee4d665d072ca1525105bcadbea9555ed21b5..ae0084c2a9b3b1c3ba9ea4d5969409cb83476861 100644 (file)
@@ -19,10 +19,8 @@ EXTRA_DIST += alloca_.h
 # We need the following in order to create <alloca.h> when the system
 # doesn't have one that works with the given compiler.
 alloca.h: alloca_.h
-       rm -f $@-t $@
-       cp $(srcdir)/alloca_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/alloca_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += alloca.h alloca.h-t
 
 Include:
index e9a5f3907c0b325a7a4853cf1e7e729fb9ab2c05..63a6a29cdfd20a007853c20bc890de138f875bab 100644 (file)
@@ -18,10 +18,8 @@ EXTRA_DIST += argz_.h
 # We need the following in order to create <argz.h> when the system
 # doesn't have one that works with the given compiler.
 argz.h: argz_.h
-       rm -f $@-t $@
-       cp $(srcdir)/argz_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/argz_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += argz.h argz.h-t
 
 Include:
index 6e44f1474c923861dabbb3e468bd7420c76207e9..cbbae09fe679f567eb291be36aebb425878ed3e8 100644 (file)
@@ -19,7 +19,6 @@ arpa/inet.h:
        test -d arpa || mkdir arpa
        rm -f $@-t $@
        echo '#include <sys/socket.h>' >$@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
 MOSTLYCLEANDIRS += arpa
index dd7d424fd0809b4425e8c86bbcc0658af1a91684..3f50ab600c11a226252540cccdcc7deca00d5801 100644 (file)
@@ -17,10 +17,8 @@ EXTRA_DIST += byteswap_.h
 # We need the following in order to create <byteswap.h> when the system
 # doesn't have one.
 byteswap.h: byteswap_.h
-       rm -f $@-t $@
-       cp $(srcdir)/byteswap_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/byteswap_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += byteswap.h byteswap.h-t
 
 Include:
index 2ffe57b2ba1c77db91351be2a94e5b368c56b096..77903c3ed5275513cd643da54a7acced48cfb936 100644 (file)
@@ -50,7 +50,6 @@ configmake.h: Makefile
          echo '#define MANDIR "$(mandir)"'; \
          echo '#define MANEXT "$(manext)"'; \
        :) | sed '/""/d' >$@-t
-       chmod a-w $@-t
        mv $@-t $@
 BUILT_SOURCES += configmake.h
 CLEANFILES += configmake.h configmake.h-t
index a12648f50bb7a78687488ccc4251a26de3baaa40..357bdfa318324020e638dce29965057574659824 100644 (file)
@@ -22,7 +22,6 @@ fcntl.h: fcntl_.h
        rm -f $@-t $@
        sed -e 's|@''ABSOLUTE_FCNTL_H''@|$(ABSOLUTE_FCNTL_H)|g' \
            < $(srcdir)/fcntl_.h > $@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += fcntl.h fcntl.h-t
 
index 8352796b98be1734c12382b09ecb90d50d119bbd..83bd17e7ca52d102c7e2c1fad377438f04723f6e 100644 (file)
@@ -22,10 +22,8 @@ EXTRA_DIST += fnmatch_.h fnmatch_loop.c
 # We need the following in order to create <fnmatch.h> when the system
 # doesn't have one that supports the required API.
 fnmatch.h: fnmatch_.h
-       rm -f $@-t $@
-       cp $(srcdir)/fnmatch_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/fnmatch_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
 
 Include:
index 8acf0fbfa2d0b628577127c796c20ff8d9b9164a..ee754bc12f82bacbec4aa09bf666616b346ffddc 100644 (file)
@@ -22,10 +22,8 @@ EXTRA_DIST += getopt_.h getopt_int.h
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
 getopt.h: getopt_.h
-       rm -f $@-t $@
-       cp $(srcdir)/getopt_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/getopt_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += getopt.h getopt.h-t
 
 Include:
index 8df7d5eb9ba473227aaa0f1baf38cee520a5628d..2dc8ce1d601aeaf55194189e28da3aa6d59fb1fa 100644 (file)
@@ -30,10 +30,8 @@ EXTRA_DIST += glob_.h glob-libc.h
 # We need the following in order to create <glob.h> when the system
 # doesn't have one that works with the given compiler.
 glob.h: glob_.h
-       rm -f $@-t $@
-       cp $(srcdir)/glob_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/glob_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += glob.h glob.h-t
 
 Include:
index ba71bc2f9d544f39e089819fab3a6aec85ac151c..0492ac1b47bc2571739d944ce80cd9fdedc49b57 100644 (file)
@@ -32,7 +32,6 @@ inttypes.h: inttypes_.h
            -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
            -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
            < $(srcdir)/inttypes_.h > $@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += inttypes.h inttypes.h-t
 
index 8075a2ca8d85292887ad253a730a3488e6610a61..596755330270372d347201f0606379805e7bc1ee 100644 (file)
@@ -61,14 +61,12 @@ uninstall-local: all-local
 charset.alias: config.charset
        rm -f t-$@ $@
        $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@
-       chmod a-w t-$@
        mv t-$@ $@
 
 SUFFIXES += .sed .sin
 .sin.sed:
        rm -f t-$@ $@
        sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@
-       chmod a-w t-$@
        mv t-$@ $@
 
 CLEANFILES += charset.alias ref-add.sed ref-del.sed
index faa01d62656da9d11e5e3837c1fbb735fdd6b53c..f65dbcc4f54b4dca16ef1ffd8ab1d9c6550e9207 100644 (file)
@@ -19,7 +19,6 @@ netinet/in.h:
        test -d netinet || mkdir netinet
        rm -f $@-t $@
        echo '#include <sys/socket.h>' >$@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
 MOSTLYCLEANDIRS += netinet
index 87454c5c66e918f27df7982df3e7f930b09a9e4c..9784c43414fa89a2443b3d1e5d6bd3af0d56845b 100644 (file)
@@ -18,10 +18,8 @@ EXTRA_DIST += poll_.h
 # We need the following in order to create <poll.h> when the system
 # doesn't have one.
 poll.h: poll_.h
-       rm -f $@-t $@
-       cp $(srcdir)/poll_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/poll_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += poll.h poll.h-t
 
 Include:
index faa2501f63ad1da5b7d7a357743a7655e91c5a0b..51fc36fc62609fcb33865fb67aed07333c5fb0d6 100644 (file)
@@ -20,7 +20,6 @@ EXTRA_DIST += stdbool_.h
 stdbool.h: stdbool_.h
        rm -f $@-t $@
        sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h > $@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += stdbool.h stdbool.h-t
 
index 57abf0e47984a090af292554010c2469452a018a..d7dd07331f6b1231b812f6c40e1237002373de5d 100644 (file)
@@ -47,7 +47,6 @@ stdint.h: stdint_.h
            -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
            -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
            < $(srcdir)/stdint_.h > $@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += stdint.h stdint.h-t
 
index 019b6debf442c2b6f6b605469ec4a26cc9d17048..80dc8faca89bd79c790de70be0dbec7bfdf95e8d 100644 (file)
@@ -19,7 +19,6 @@ sys/select.h:
        test -d sys || mkdir sys
        rm -f $@-t $@
        echo '#include <sys/socket.h>' >$@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += sys/select.h sys/select.h-t
 MOSTLYCLEANDIRS += sys
index 128f0cbd89b0824ab1c452e192e8db2989da1eac..a27b87ca6ef1f651e147bf228fe8ce83ebefe062 100644 (file)
@@ -19,10 +19,8 @@ EXTRA_DIST += socket_.h
 # doesn't have one that works with the given compiler.
 sys/socket.h: socket_.h
        test -d sys || mkdir sys
-       rm -f $@-t $@
-       cp $(srcdir)/socket_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/socket_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
 MOSTLYCLEANDIRS += sys
 
index 33ff8e1522b4a310b475bbf85237db854d8a917e..4fc957ffc88d8e647f994a4f2940e4518db09c66 100644 (file)
@@ -22,7 +22,6 @@ sys/stat.h: stat_.h
        rm -f $@-t $@
        sed -e 's|@''ABSOLUTE_SYS_STAT_H''@|$(ABSOLUTE_SYS_STAT_H)|g' \
            < $(srcdir)/stat_.h > $@-t
-       chmod a-w $@-t
        mv $@-t $@
 MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
 MOSTLYCLEANDIRS += sys
index c974a240a754f2a3cc66f853ea3d770a532e47ee..2872e36459f3896903bb7f0682b341246493fc49 100644 (file)
@@ -17,10 +17,8 @@ EXTRA_DIST += sysexit_.h
 # We need the following in order to create <sysexits.h> when the system
 # doesn't have one that works with the given compiler.
 sysexits.h: sysexit_.h
-       rm -f $@-t $@
-       cp $(srcdir)/sysexit_.h $@-t
-       chmod a-w $@-t
-       mv $@-t $@
+       cp -f $(srcdir)/sysexit_.h $@-t
+       mv -f $@-t $@
 MOSTLYCLEANFILES += sysexits.h sysexits.h-t
 
 Include: