]> arthur.barton.de Git - bup.git/commitdiff
Add make export-docs/push-docs/import-docs targets. bup-0.20
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 9 Nov 2010 06:05:54 +0000 (22:05 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 9 Nov 2010 06:10:54 +0000 (22:10 -0800)
export-docs: update local 'man' and 'html' branches with pregenerated doc
files.

push-docs: push those to origin/man and origin/html.

import-docs: extract the documentation from origin/man and origin/html into
the local tree so it can be installed.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Makefile

index 0faf8a684ff7d4967878587bf0de56c18fa53617..a9c8f04e2acb10ea055202568795af7835c04539 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -119,6 +119,35 @@ bup-%: cmd-%.sh
 
 %.o: %.c
        gcc -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
+       
+# update the local 'man' and 'html' branches with pregenerated output files, for
+# people who don't have pandoc (and maybe to aid in google searches or something)
+export-docs: Documentation/all
+       git update-ref refs/heads/man origin/man '' 2>/dev/null || true
+       git update-ref refs/heads/html origin/html '' 2>/dev/null || true
+       GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
+       rm -f $${GIT_INDEX_FILE} && \
+       git add -f Documentation/*.1 && \
+       git update-ref refs/heads/man \
+               $$(echo "Autogenerated man pages for $$(git describe)" \
+                   | git commit-tree $$(git write-tree --prefix=Documentation) \
+                               -p refs/heads/man) && \
+       rm -f $${GIT_INDEX_FILE} && \
+       git add -f Documentation/*.html && \
+       git update-ref refs/heads/html \
+               $$(echo "Autogenerated html pages for $$(git describe)" \
+                   | git commit-tree $$(git write-tree --prefix=Documentation) \
+                               -p refs/heads/html)
+
+# push the pregenerated doc files to origin/man and origin/html
+push-docs: export-docs
+       git push origin man html
+
+# import pregenerated doc files from origin/man and origin/html, in case you
+# don't have pandoc but still want to be able to install the docs.
+import-docs: Documentation/clean
+       git archive origin/html | (cd Documentation; tar -xvf -)
+       git archive origin/man | (cd Documentation; tar -xvf -)
 
 clean: Documentation/clean
        rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll *.exe \