aboutsummaryrefslogtreecommitdiffstats
path: root/buildconfigs/src.hg-clone
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@xensource.com>2007-05-31 14:51:09 +0100
committerIan Campbell <ian.campbell@xensource.com>2007-05-31 14:51:09 +0100
commita7cc66ccfc184794b1848102d097b89394263ecb (patch)
tree85a2fb636b480275265b6cc2d058cec0fad5ef87 /buildconfigs/src.hg-clone
parent06bdfbd284b63c5ace60a0dfa58463e9e51163ee (diff)
downloadxen-a7cc66ccfc184794b1848102d097b89394263ecb.tar.gz
xen-a7cc66ccfc184794b1848102d097b89394263ecb.tar.bz2
xen-a7cc66ccfc184794b1848102d097b89394263ecb.zip
Updates for XEN_LINUX_SOURCE=hg-clone.
By default search for mercurial repositories in $(LINUX_SRC_PATH) followed by a location derived from the current Xen repository's default parent. e.g. A clone of http://xenbits.xensource.com/xen-unstable.hg will derive http://xenbits.xensource.com/linux-2.6.18-xen.hg. A specific repository can be specified by giving XEN_LINUX_HGREPO=<URL or path> on the make command line. Add capability to put XEN_LINUX_UPDATE=y on the make command line to update the Linux repository. Disabled by default since we don't want to touch a developers repository without permission. Dropped XEN_LINUX_HGUPDATES since it was unecessary and confusing. Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Diffstat (limited to 'buildconfigs/src.hg-clone')
-rw-r--r--buildconfigs/src.hg-clone45
1 files changed, 29 insertions, 16 deletions
diff --git a/buildconfigs/src.hg-clone b/buildconfigs/src.hg-clone
index f387a95b6a..ab732770e8 100644
--- a/buildconfigs/src.hg-clone
+++ b/buildconfigs/src.hg-clone
@@ -1,26 +1,39 @@
-# Main repository to clone.
-XEN_LINUX_HGREPO ?= http://xenbits.xensource.com/linux-$(LINUX_VER)-xen.hg
+# Mercurial
+HG ?= hg
-# Set this to pull additional changesets from a second source.
+LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.hg
-# This can be useful if you use a local mirror for XEN_LINUX_HGREPO
-# (to reduce time spent cloning) but still want to pull the very
-# latest changesets from xenbits.
-XEN_LINUX_HGUPDATES ?=
+# Repository to clone.
+XEN_LINUX_HGREPO ?= $$(sh buildconfigs/select-repository $(LINUX_SRCDIR) $(LINUX_SRC_PATH))
-# Set this to update to a particlar revision.
-XEN_LINUX_HGREV ?=
+# The source directory is not automatically updated to avoid blowing
+# away developer's changes. If you want to automatically pull a new
+# version of the Linux tree then add `XEN_LINUX_UPDATE=y' to your make
+# command line.
+ifeq ($(XEN_LINUX_UPDATE),y)
+__XEN_LINUX_UPDATE = $(LINUX_SRCDIR)/.force-update
+else
+__XEN_LINUX_UPDATE =
+endif
-LINUX_SRCDIR ?= linux-$(LINUX_VER)-xen.hg
+# Set XEN_LINUX_HGREV to update to a particlar revision.
+XEN_LINUX_HGREV ?= tip
-$(LINUX_SRCDIR)/.valid-src:
+$(LINUX_SRCDIR)/.valid-src: $(__XEN_LINUX_UPDATE)
+ set -e ; __repo=$(XEN_LINUX_HGREPO) ; \
if [ ! -d $(LINUX_SRCDIR) ] ; then \
- hg clone $(XEN_LINUX_HGREPO) $(LINUX_SRCDIR) ; \
- fi
- if [ -n "$(XEN_LINUX_HGUPDATES)" ] ; then \
- hg pull -R $(LINUX_SRCDIR) $(XEN_LINUX_HGUPDATES) ; \
+ echo "Cloning $${__repo} to $(LINUX_SRCDIR)." ; \
+ $(HG) clone $${__repo} $(LINUX_SRCDIR) ; \
+ else \
+ echo "Pulling changes from $${__repo} into $(LINUX_SRCDIR)." ; \
+ $(HG) -R $(LINUX_SRCDIR) pull $${__repo} ; \
fi
if [ -n "$(XEN_LINUX_HGREV)" ] ; then \
- hg update -R $(LINUX_SRCDIR) $(XEN_LINUX_HGREV) ; \
+ echo "Updating $(LINUX_SRCDIR) to revision $(XEN_LINUX_HGREV)." ; \
+ $(HG) update -R $(LINUX_SRCDIR) $(XEN_LINUX_HGREV) ; \
fi
touch $@
+
+.PHONY: $(LINUX_SRCDIR)/.force-update
+$(LINUX_SRCDIR)/.force-update:
+ @ :