{"thread":{"id":"11173","subject":"[PATCH] git-help: fix looking up html install dir when browsing.","startedAt":"2007-12-07T05:29:23Z","lastAt":"2007-12-07T05:29:23Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"62240","messageId":"20071207062923.6663a7d1.chriscool@tuxfamily.org","threadId":"11173","inReplyTo":null,"subject":"[PATCH] git-help: fix looking up html install dir when browsing.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2007-12-07T05:29:23Z","receivedAt":"2007-12-07T05:29:23Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"We used to search for the following directories:\n\n\t- $PREFIX/share/doc/git-doc\n\t- $PREFIX/share/doc/git-core-$GIT_VERSION\n\nThis was wrong because \"htmldir\" could be defined in the\nMakefiles to something completely different.\n\nSo we now look for the $htlmdir directory first. But if\nit fails we still fall back to the two above directories,\nin case the script install and the html doc install have\nbeen done with different $htmldir.\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Makefile           |    5 ++++-\n git-browse-help.sh |    4 +++-\n 2 files changed, 7 insertions(+), 2 deletions(-)\n\n\tJunio wrote:\n\t> People can set htmldir to somewhere other than\n\t> $(prefix)/share/doc/git-doc while building and\n\t> installing, but you are not telling the munged\n\t> script where it is.\n\n\tThis should fix it.\n\tThanks.\n\ndiff --git a/Makefile b/Makefile\nindex e9a119a..1e31f02 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -157,6 +157,7 @@ bindir = $(prefix)/bin\n gitexecdir = $(bindir)\n sharedir = $(prefix)/share\n template_dir = $(sharedir)/git-core/templates\n+htmldir=$(sharedir)/doc/git-doc\n ifeq ($(prefix),/usr)\n sysconfdir = /etc\n else\n@@ -183,7 +184,7 @@ GITWEB_FAVICON = git-favicon.png\n GITWEB_SITE_HEADER =\n GITWEB_SITE_FOOTER =\n \n-export prefix bindir gitexecdir sharedir template_dir sysconfdir\n+export prefix bindir gitexecdir sharedir template_dir htmldir sysconfdir\n \n CC = gcc\n AR = ar\n@@ -747,6 +748,7 @@ DESTDIR_SQ = $(subst ','\\'',$(DESTDIR))\n bindir_SQ = $(subst ','\\'',$(bindir))\n gitexecdir_SQ = $(subst ','\\'',$(gitexecdir))\n template_dir_SQ = $(subst ','\\'',$(template_dir))\n+htmldir_SQ = $(subst ','\\'',$(htmldir))\n prefix_SQ = $(subst ','\\'',$(prefix))\n \n SHELL_PATH_SQ = $(subst ','\\'',$(SHELL_PATH))\n@@ -811,6 +813,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh\n \t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \\\n \t    -e 's/@@NO_CURL@@/$(NO_CURL)/g' \\\n \t    -e 's|@@PREFIX@@|$(prefix_SQ)|g' \\\n+\t    -e 's|@@HTMLDIR@@|$(htmldir_SQ)|g' \\\n \t    $@.sh >$@+ && \\\n \tchmod +x $@+ && \\\n \tmv $@+ $@\ndiff --git a/git-browse-help.sh b/git-browse-help.sh\nindex 11f8bfa..12d313a 100755\n--- a/git-browse-help.sh\n+++ b/git-browse-help.sh\n@@ -21,6 +21,8 @@ SUBDIRECTORY_OK=Yes\n OPTIONS_SPEC=\n . git-sh-setup\n \n+# Install data.\n+special_html_dir=\"@@HTMLDIR@@\"\n PREFIX=\"@@PREFIX@@\"\n GIT_VERSION=\"@@GIT_VERSION@@\"\n \n@@ -30,7 +32,7 @@ rpm_dir=\"$PREFIX/share/doc/git-core-$GIT_VERSION\"\n \n # Look for the directory that really contains html documentation.\n html_dir=''\n-for dir in \"$install_html_dir\" \"$rpm_dir\"\n+for dir in \"$special_html_dir\" \"$install_html_dir\" \"$rpm_dir\"\n do\n \ttest -d \"$dir\" && { html_dir=\"$dir\" ; break ; }\n done\n-- \n1.5.3.6.1993.g154f-dirty\n"}]}