Git development
 help / color / mirror / Atom feed
* [PATCH] Makefile: add clean-obsolete-scripts target
@ 2007-01-10 12:20 Johannes Schindelin
  2007-01-10 12:53 ` Alex Riesen
  2007-01-10 20:22 ` Junio C Hamano
  0 siblings, 2 replies; 10+ messages in thread
From: Johannes Schindelin @ 2007-01-10 12:20 UTC (permalink / raw)
  To: git, junkio


On Cygwin, newly builtins are not recognized, because there exist both
the executable binaries (with .exe extension) _and_ the now-obsolete
scripts (without extension), but the script is executed.

"make clean-obsolete-scripts" removes these ambiguities by removing the
older of these file pairs.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 Makefile |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 007ceb2..a46683a 100644
--- a/Makefile
+++ b/Makefile
@@ -905,6 +905,25 @@ dist-doc:
 
 ### Cleaning rules
 
+clean-obsolete-scripts:
+	@if test -n "$X"; \
+	then \
+		ls *$X '$(DESTDIR_SQ)$(gitexecdir_SQ)'/*$X | while read f; do \
+			script="`echo "$$f" | sed 's/$X\$$/./'`"; \
+			if test -f "$$script"; \
+			then \
+				if test "$$script" -ot "$$f"; \
+				then \
+					echo removing "$$script"; \
+					rm "$$script"; \
+				else \
+					echo removing "$$f"; \
+					rm "$$f"; \
+				fi; \
+			fi; \
+		done; \
+	fi
+
 clean:
 	rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
 		$(LIB_FILE) $(XDIFF_LIB)
-- 
1.4.4.4.g774d-dirty

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-01-11 21:41 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-10 12:20 [PATCH] Makefile: add clean-obsolete-scripts target Johannes Schindelin
2007-01-10 12:53 ` Alex Riesen
2007-01-10 13:42   ` Johannes Schindelin
2007-01-10 13:52     ` Alex Riesen
2007-01-10 20:22 ` Junio C Hamano
2007-01-10 21:26   ` Alex Riesen
2007-01-11  0:34     ` Junio C Hamano
2007-01-11 21:41       ` Alex Riesen
2007-01-11  8:22   ` Johannes Schindelin
2007-01-11  8:32     ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox