3 # "git-doc" is a clone of the git.git repository and has the master
4 # branch checked out. We update the working tree and prepare
5 # preformatted documentation pages, and install them in doc-htmlpages
6 # and doc-manapges subdirectories. When they are updated, they are
7 # pushed back into their own repositories next to the git.git
12 : ${TOP=/srv/project/git}
14 MASTERREPO
=$TOP/git.git
/
15 MANREPO
=$TOP/git-manpages.git
/
16 HTMLREPO
=$TOP/git-htmldocs.git
/
19 TARGETVAR
=$
(echo "$1"REPO |
tr 'a-z' 'A-Z') &&
20 eval "echo \$$TARGETVAR"
23 DOCREPO
=$
(pwd) ;# "git-doc"
26 ID
=$
(cd "$MASTERREPO" && git rev-parse
--verify refs
/heads
/master
) ||
exit $?
29 trap 'rm -f "$tmp".*' 0
32 git pull
--ff-only "$MASTERREPO" master
&&
33 git fetch
--tags "$MASTERREPO"
36 test $
(git rev-parse
--verify refs
/heads
/master
) = "$ID" &&
37 NID
=$
(git describe
--abbrev=4 "$ID") &&
38 test -n "$NID" ||
exit $?
42 # Set up subrepositories
45 test -d doc-
${type}pages
&& continue
47 git init doc-
${type}pages
&&
48 cd doc-
${type}pages ||
exit
49 TARGETREPO
=$
(target_repo
$type) &&
50 git pull
"$TARGETREPO" master
52 rm -fr doc-
$type-inst &&
53 mkdir
-p doc-
$type-inst &&
55 cd doc-
${type}pages
&& git archive HEAD
58 cd doc-
$type-inst && tar xf
-
62 # The below used to contain this instead...
63 # MAN_BASE_URL="http://www.kernel.org/pub/software/scm/git/docs/"
65 ASCIIDOC_NO_ROFF=YesPlease
67 MAN_BASE_URL="git-htmldocs/"
76 rm -fr doc-html-inst doc-man-inst
&&
77 mkdir doc-html-inst doc-man-inst ||
exit
85 -C Documentation
-j 2 $dd \
86 WEBDOC_DEST
="$DOCREPO/doc-html-inst" install-webdoc ||
exit
89 -C Documentation
-j 2 $dd \
90 man1
="$DOCREPO/doc-man-inst/man1" \
91 man5
="$DOCREPO/doc-man-inst/man5" \
92 man7
="$DOCREPO/doc-man-inst/man7" \
93 man1dir
="$DOCREPO/doc-man-inst/man1" \
94 man5dir
="$DOCREPO/doc-man-inst/man5" \
95 man7dir
="$DOCREPO/doc-man-inst/man7" install ||
exit
99 find doc-
$type-inst -type f |
102 it
=$
(expr "$path" : doc-
$type-inst/'\(.*\)') ||
continue
103 t
="doc-${type}pages/$it"
104 test -f "$t" && diff -q "$path" "$t" && continue
105 mkdir
-p "$(dirname "$t")" &&
106 echo ": $t" && rm -f "$t" && ln "$path" "$t" ||
exit
107 ( cd doc-
${type}pages
&& git add
"$it" )
110 find doc-
$type-inst -type f |
111 sed -e 's|^doc-'$type'-inst/||' |
sort >"$tmp.1" &&
112 (cd doc-
${type}pages
&& git ls-files |
sort) >"$tmp.2" &&
113 comm -13 "$tmp.1" "$tmp.2" |
114 ( cd doc-
${type}pages
&& xargs rm -f -- ) ||
exit
123 ln -sf git.html index.html
131 if git commit
-a -m "Autogenerated $TYPE for $NID"
133 TARGETREPO
=$
(target_repo
$type) &&
134 git push
"$TARGETREPO" master
:master
136 echo "* No changes in $type docs"