Makefile: add quick-install-doc for installing pre-built manpages
This adds and uses the install-doc-quick.sh file to Documentation/, which is usable for people who track either the 'html' or 'man' heads in Junio's repository (prefixed with 'origin/' if cloned locally). You may override this by specifying DOC_REF in the make environment or in config.mak. GZ may also be set in the environment (or config.mak) if you wish to gzip the documentation after installing it. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong committed
Dec 23, 2006 at 08:26 UTC
6538d1ef31fc2989e4dd0422a31a170a7d560b02
3 files changed
+37
Documentation/Makefile
+4
@@ -32,6 +32,7 @@ man7dir=$(mandir)/man7
32
# DESTDIR=
33
34
INSTALL?=install
35
+DOC_REF = origin/man
36
37
-include ../config.mak.autogen
38
@@ -112,3 +113,6 @@ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
113
114
install-webdoc : html
115
sh ./install-webdoc.sh $(WEBDOC_DEST)
116
+
117
+quick-install:
118
+ sh ./install-doc-quick.sh $(DOC_REF) $(mandir)
Documentation/install-doc-quick.sh
new
+31
@@ -0,0 +1,31 @@
1
+#!/bin/sh
2
+# This requires a branch named in $head
3
+# (usually 'man' or 'html', provided by the git.git repository)
4
+set -e
5
+head="$1"
6
+mandir="$2"
7
+SUBDIRECTORY_OK=t
8
+USAGE='<refname> <target directory>'
9
+. git-sh-setup
10
+export GIT_DIR
11
+
12
+test -z "$mandir" && usage
13
+if ! git-rev-parse --verify "$head^0" >/dev/null; then
14
+ echo >&2 "head: $head does not exist in the current repository"
15
+ usage
16
+fi
17
+
18
+GIT_INDEX_FILE=`pwd`/.quick-doc.index
19
+export GIT_INDEX_FILE
20
+rm -f "$GIT_INDEX_FILE"
21
+git-read-tree $head
22
+git-checkout-index -a -f --prefix="$mandir"/
23
+
24
+if test -n "$GZ"; then
25
+ cd "$mandir"
26
+ for i in `git-ls-tree -r --name-only $head`
27
+ do
28
+ gzip < $i > $i.gz && rm $i
29
+ done
30
+fi
31
+rm -f "$GIT_INDEX_FILE"
Makefile
+2
@@ -824,6 +824,8 @@ install: all
824
install-doc:
825
$(MAKE) -C Documentation install
826
827
+quick-install-doc:
828
+ $(MAKE) -C Documentation quick-install
829
830
831