{"thread":{"id":"2523","subject":"[PATCH] Introduce cg-version.in template","startedAt":"2005-11-15T12:23:23Z","lastAt":"2005-11-15T12:23:23Z","messageCount":1,"participants":["Jonas Fonseca"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11892","messageId":"20051115122323.GB13925@diku.dk","threadId":"2523","inReplyTo":null,"subject":"[PATCH] Introduce cg-version.in template","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-11-15T12:23:23Z","receivedAt":"2005-11-15T12:23:23Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\ndiff --git a/Makefile b/Makefile\nindex 72d7d12..700491f 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -37,24 +37,14 @@ cogito: $(GEN_SCRIPT)\n \n ifneq (,$(wildcard .git))\n GIT_HEAD=.git/$(shell git-symbolic-ref HEAD)\n-GIT_HEAD_ID=\" \\($(shell cat $(GIT_HEAD))\\)\"\n+GIT_HEAD_ID=($(shell cat $(GIT_HEAD)))\n endif\n-cg-version: $(VERSION) $(GIT_HEAD) Makefile\n+cg-version: cg-version.in $(VERSION) $(GIT_HEAD)\n \t@echo Generating cg-version...\n \t@rm -f $@\n-\t@echo \"#!/bin/sh\" > $@\n-\t@echo \"#\" >> $@\n-\t@echo \"# Show the version of the Cogito toolkit.\" >> $@\n-\t@echo \"# Copyright (c) Petr Baudis, 2005\" >> $@\n-\t@echo \"#\" >> $@\n-\t@echo \"# Show which version of Cogito is installed.\" >> $@\n-\t@echo \"# Additionally, the 'HEAD' of the installed Cogito\" >> $@\n-\t@echo \"# is also shown if this information was available\" >> $@\n-\t@echo \"# at the build time.\" >> $@\n-\t@echo >> $@\n-\t@echo \"USAGE=\\\"cg-version\\\"\" >> $@\n-\t@echo >> $@\n-\t@echo \"echo \\\"$(shell cat $(VERSION))$(GIT_HEAD_ID)\\\"\" >> $@\n+\t@sed -e 's/@@VERSION@@/$(shell cat $(VERSION))/' \\\n+\t     -e 's/@@GIT_HEAD_ID@@/$(GIT_HEAD_ID)/' \\\n+\t     < $< > $@ \n \t@chmod +x $@\n \n doc:\ndiff --git a/cg-version.in b/cg-version.in\nnew file mode 100644\nindex 0000000..369818e\n--- /dev/null\n+++ b/cg-version.in\n@@ -0,0 +1,16 @@\n+#!/usr/bin/env bash\n+#\n+# Show the version of the Cogito toolkit.\n+# Copyright (c) Petr Baudis, 2005\n+#\n+# Show which version of Cogito is installed.\n+# Additionally, the 'HEAD' of the installed Cogito\n+# is also shown if this information was available\n+# at the build time.\n+\n+USAGE=\"cg-version\"\n+_git_repo_unneeded=1\n+\n+. ${COGITO_LIB}cg-Xlib || exit 1\n+\n+echo \"@@VERSION@@ @@GIT_HEAD_ID@@\"\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 4fe009a..3aad2fb 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -1,4 +1,4 @@\n-CG_IGNORE=$(wildcard ../cg-X* ../cg-*.orig ../cg-*.rej)\n+CG_IGNORE=$(wildcard ../cg-X* ../cg-*.orig ../cg-*.rej ../cg-*.in)\n CG_SRC=$(filter-out $(CG_IGNORE), $(wildcard ../cg*))\n \n PACKAGE=cogito\n-- \nJonas Fonseca\n"}]}