git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Junio Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] git-help: fix looking up html install dir when browsing.
Date: Fri, 7 Dec 2007 06:29:23 +0100	[thread overview]
Message-ID: <20071207062923.6663a7d1.chriscool@tuxfamily.org> (raw)

We used to search for the following directories:

	- $PREFIX/share/doc/git-doc
	- $PREFIX/share/doc/git-core-$GIT_VERSION

This was wrong because "htmldir" could be defined in the
Makefiles to something completely different.

So we now look for the $htlmdir directory first. But if
it fails we still fall back to the two above directories,
in case the script install and the html doc install have
been done with different $htmldir.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Makefile           |    5 ++++-
 git-browse-help.sh |    4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

	Junio wrote:
	> People can set htmldir to somewhere other than
	> $(prefix)/share/doc/git-doc while building and
	> installing, but you are not telling the munged
	> script where it is.

	This should fix it.
	Thanks.

diff --git a/Makefile b/Makefile
index e9a119a..1e31f02 100644
--- a/Makefile
+++ b/Makefile
@@ -157,6 +157,7 @@ bindir = $(prefix)/bin
 gitexecdir = $(bindir)
 sharedir = $(prefix)/share
 template_dir = $(sharedir)/git-core/templates
+htmldir=$(sharedir)/doc/git-doc
 ifeq ($(prefix),/usr)
 sysconfdir = /etc
 else
@@ -183,7 +184,7 @@ GITWEB_FAVICON = git-favicon.png
 GITWEB_SITE_HEADER =
 GITWEB_SITE_FOOTER =
 
-export prefix bindir gitexecdir sharedir template_dir sysconfdir
+export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir
 
 CC = gcc
 AR = ar
@@ -747,6 +748,7 @@ DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
 template_dir_SQ = $(subst ','\'',$(template_dir))
+htmldir_SQ = $(subst ','\'',$(htmldir))
 prefix_SQ = $(subst ','\'',$(prefix))
 
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
@@ -811,6 +813,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
 	    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
 	    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
 	    -e 's|@@PREFIX@@|$(prefix_SQ)|g' \
+	    -e 's|@@HTMLDIR@@|$(htmldir_SQ)|g' \
 	    $@.sh >$@+ && \
 	chmod +x $@+ && \
 	mv $@+ $@
diff --git a/git-browse-help.sh b/git-browse-help.sh
index 11f8bfa..12d313a 100755
--- a/git-browse-help.sh
+++ b/git-browse-help.sh
@@ -21,6 +21,8 @@ SUBDIRECTORY_OK=Yes
 OPTIONS_SPEC=
 . git-sh-setup
 
+# Install data.
+special_html_dir="@@HTMLDIR@@"
 PREFIX="@@PREFIX@@"
 GIT_VERSION="@@GIT_VERSION@@"
 
@@ -30,7 +32,7 @@ rpm_dir="$PREFIX/share/doc/git-core-$GIT_VERSION"
 
 # Look for the directory that really contains html documentation.
 html_dir=''
-for dir in "$install_html_dir" "$rpm_dir"
+for dir in "$special_html_dir" "$install_html_dir" "$rpm_dir"
 do
 	test -d "$dir" && { html_dir="$dir" ; break ; }
 done
-- 
1.5.3.6.1993.g154f-dirty

                 reply	other threads:[~2007-12-07  5:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071207062923.6663a7d1.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).