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>
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 18a92b4..72e3f86 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -32,6 +32,7 @@
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 @@
@-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