* [PATCH] git-help: fix looking up html install dir when browsing.
@ 2007-12-07 5:29 Christian Couder
0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2007-12-07 5:29 UTC (permalink / raw)
To: Junio Hamano; +Cc: git
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-07 5:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-07 5:29 [PATCH] git-help: fix looking up html install dir when browsing Christian Couder
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).