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

[PATCH] Fix cg-version -h by sourcing cg-Xlib

From
Jonas Fonseca <fonseca@diku.dk>
Date
Nov 15, 2005, 12:03 UTC
Message-ID
<20051115120312.GA13925@diku.dk>
Also requires cg-version to become a bash script.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
diff --git a/Makefile b/Makefile
index 72d7d12..b18e79f 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ endif
 cg-version: $(VERSION) $(GIT_HEAD) Makefile
 	@echo Generating cg-version...
 	@rm -f $@
-	@echo "#!/bin/sh" > $@
+	@echo "#!/usr/bin/env bash" >> $@
 	@echo "#" >> $@
 	@echo "# Show the version of the Cogito toolkit." >> $@
 	@echo "# Copyright (c) Petr Baudis, 2005" >> $@
@@ -53,6 +53,9 @@ cg-version: $(VERSION) $(GIT_HEAD) Makef
 	@echo "# at the build time." >> $@
 	@echo >> $@
 	@echo "USAGE=\"cg-version\"" >> $@
+	@echo "_git_repo_unneeded=1" >> $@
+	@echo >> $@
+	@echo ". \$${COGITO_LIB}cg-Xlib || exit 1" >> $@
 	@echo >> $@
 	@echo "echo \"$(shell cat $(VERSION))$(GIT_HEAD_ID)\"" >> $@
 	@chmod +x $@
@@ -92,7 +95,7 @@ install-cogito: $(SCRIPT) $(LIB_SCRIPT) 
 	$(INSTALL) -m755 -d $(DESTDIR)$(libdir)
 	$(INSTALL) $(LIB_SCRIPT) $(DESTDIR)$(libdir)
 	cd $(DESTDIR)$(bindir); \
-	for file in $(SCRIPT); do \
+	for file in $(SCRIPT) $(GEN_SCRIPT); do \
 		sed -e 's/\$${COGITO_LIB}/"\$${COGITO_LIB:-$(sedlibdir)\/}"/g' $$file > $$file.new; \
 		cat $$file.new > $$file; rm $$file.new; \
 	done
-- 
Jonas Fonseca
Message 1 of 1 in “Fix cg-version -h by sourcing cg-Xlib”
  1. Fix cg-version -h by sourcing cg-XlibJonas Fonseca, Nov 15, 2005

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.