DORMANTno replies

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

From: Jonas Fonseca <hidden>
Date: 2016-06-15 22:42:11
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

Also requires cg-version to become a bash script.

Signed-off-by: Jonas Fonseca <redacted>
---
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help