documentation: Use a variable to select the prior version

This way we can set which version to copy the documentation files
from when setting up a new revision.

Change-Id: I0c9392e97b6c3da21500f173336e891ee3a91b76
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-07-28 14:14:53 -07:00
parent 9a44ce5bea
commit 788e1a9b72

View File

@@ -32,6 +32,7 @@ LOCAL_ROOT := .published
SCRIPTSDIR := $(shell pwd)/javascript
COMMIT := $(shell git describe HEAD | sed s/^v//)
PUB_DIR := $(PUB_ROOT)/$(VERSION)
PRIOR = PRIOR
ifeq ($(VERSION),)
REVISION = $(COMMIT)
@@ -52,9 +53,8 @@ endif
@-rm -rf $(LOCAL_ROOT)
@echo "Checking out current $(VERSION)"
@if ! $(SVN) checkout $(PUB_DIR) $(LOCAL_ROOT) 2>/dev/null ; then \
p=$$(git describe HEAD^ | perl -lne 'print $$1 if /^v(\d+\.\d+(?:\.\d+)?)/') && \
echo "Copying $$p to $(VERSION) ..." && \
$(SVN) cp -m "Create $(VERSION) documentation" $(PUB_ROOT)/$$p $(PUB_DIR) && \
echo "Copying $(PRIOR) to $(VERSION) ..." && \
$(SVN) cp -m "Create $(VERSION) documentation" $(PUB_ROOT)/$(PRIOR) $(PUB_DIR) && \
$(SVN) checkout $(PUB_DIR) $(LOCAL_ROOT) ; \
fi
@rm -f $(LOCAL_ROOT)/*.html