git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Makefile: add clean-obsolete-scripts target

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 10, 2007, 12:20 UTC
Message-ID
<Pine.LNX.4.63.0701101319480.22628@wbgn013.biozentrum.uni-wuerzburg.de>

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
Next: Alex Riesen
Message 1 of 10 in “Makefile: add clean-obsolete-scripts target”
  1. Makefile: add clean-obsolete-scripts targetJohannes Schindelin, Jan 10, 2007
  2. Alex RiesenJan 10, 2007
  3. Johannes SchindelinJan 10, 2007
  4. Alex RiesenJan 10, 2007
  5. Junio C HamanoJan 10, 2007
  6. Alex RiesenJan 10, 2007
  7. Junio C HamanoJan 11, 2007
  8. Alex RiesenJan 11, 2007
  9. Johannes SchindelinJan 11, 2007
  10. Johannes SchindelinJan 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.