GNU bug report logs - #17798
[PATCH] build: don't make output files read-only

Previous Next

Package: grep;

Reported by: Paul Eggert <eggert <at> CS.UCLA.EDU>

Date: Tue, 17 Jun 2014 19:07:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17798 in the body.
You can then email your comments to 17798 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#17798; Package grep. (Tue, 17 Jun 2014 19:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> CS.UCLA.EDU>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Tue, 17 Jun 2014 19:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> CS.UCLA.EDU>
To: bug-grep <at> gnu.org
Subject: [PATCH] build: don't make output files read-only
Date: Tue, 17 Jun 2014 12:02:01 -0700
This led to problems, such as the prompt "mv: try to overwrite
'egrep', overriding mode 0555 (r-xr-xr-x)? " during a build.
It can be worked around, but the cure is worse than the disease;
making output files read-only is more trouble than it's worth.
* doc/Makefile.am (grep.1, egrep.1, fgrep.1):
* lib/Makefile.am (colorize.c):
* src/Makefile.am (egrep fgrep):
Don't make output files read-only.  Prefer separate commands to
'&&' when either will do.
---
 doc/Makefile.am | 11 +++++------
 lib/Makefile.am |  2 --
 src/Makefile.am |  5 ++---
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 810e916..9a50434 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -25,11 +25,10 @@ EXTRA_DIST = grep.in.1
 CLEANFILES = grep.1 egrep.1 fgrep.1
 
 grep.1: grep.in.1
-	$(AM_V_GEN)rm -f $@ $@-t
-	$(AM_V_at)sed 's/@''VERSION@/$(VERSION)/' \
-	  < $(srcdir)/grep.in.1 > $@-t && chmod 444 $@-t && mv $@-t $@
+	$(AM_V_GEN)sed 's/@''VERSION@/$(VERSION)/' < $(srcdir)/grep.in.1 > $@-t
+	$(AM_V_at)mv $@-t $@
 
 egrep.1 fgrep.1: Makefile.am
-	$(AM_V_GEN)rm -f $@ $@-t
-	$(AM_V_at)inst=`echo grep | sed '$(transform)'`.1 \
-	  && echo ".so man1/$$inst" > $@-t && chmod 444 $@-t && mv $@-t $@
+	$(AM_V_GEN)inst=`echo grep | sed '$(transform)'`.1 \
+	  && echo ".so man1/$$inst" > $@-t
+	$(AM_V_at)mv $@-t $@
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 9bd7b0d..79d582b 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -34,9 +34,7 @@ libgreputils_a_SOURCES += colorize.h
 EXTRA_DIST += colorize-posix.c colorize-w32.c
 CLEANFILES += colorize.c
 colorize.c:
-	$(AM_V_GEN)rm -f $@-t
 	$(AM_V_at)echo '#include <$(COLORIZE_SOURCE)>' >$@-t
-	$(AM_V_at)chmod a=rx $@-t
 	$(AM_V_at)mv $@-t $@
 
 libgreputils_a_LIBADD += $(LIBOBJS) $(ALLOCA)
diff --git a/src/Makefile.am b/src/Makefile.am
index 0697c63..11acdb1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -45,8 +45,7 @@ AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
 EXTRA_DIST = dosbuf.c egrep.sh
 
 egrep fgrep: egrep.sh Makefile
-	$(AM_V_GEN)rm -f $@-t
-	$(AM_V_at)grep=`echo grep | sed -e '$(transform)'` &&		\
+	$(AM_V_GEN)grep=`echo grep | sed -e '$(transform)'` &&		\
 	case $@ in egrep) option=-E;; fgrep) option=-F;; esac &&	\
 	shell_does_substrings='set x/y && d=$${1%/*} && test "$$d" = x' && \
 	if $(SHELL) -c "$$shell_does_substrings" 2>/dev/null; then	\
@@ -58,7 +57,7 @@ egrep fgrep: egrep.sh Makefile
 	    -e "$$edit_substring"					\
 	    -e "s|[@]grep@|$$grep|g"					\
 	    -e "s|[@]option@|$$option|g" <$(srcdir)/egrep.sh >$@-t
-	$(AM_V_at)chmod a=rx $@-t
+	$(AM_V_at)chmod +x $@-t
 	$(AM_V_at)mv $@-t $@
 
 CLEANFILES = egrep fgrep *-t
-- 
1.9.3





bug closed, send any further explanations to 17798 <at> debbugs.gnu.org and Paul Eggert <eggert <at> CS.UCLA.EDU> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Tue, 17 Jun 2014 19:23:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 Jul 2014 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 342 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.