ia64/xen-unstable

changeset 15270:c09dbe98e4d6

If we find a Linux repository in $(LINUX_SRC_PATH) then symlink it
instead of cloning it. This enables developers to keep a linux tree
separate to their xen repository and to make changes there which are
picked up by the Xen build.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
author Ian Campbell <ian.campbell@xensource.com>
date Mon Jun 04 15:41:32 2007 +0100 (2007-06-04)
parents 5710c94e6539
children 6f13c3be08fa
files buildconfigs/src.hg-clone
line diff
     1.1 --- a/buildconfigs/src.hg-clone	Mon Jun 04 15:32:11 2007 +0100
     1.2 +++ b/buildconfigs/src.hg-clone	Mon Jun 04 15:41:32 2007 +0100
     1.3 @@ -20,17 +20,24 @@ endif
     1.4  XEN_LINUX_HGREV  ?= tip
     1.5  
     1.6  $(LINUX_SRCDIR)/.valid-src: $(__XEN_LINUX_UPDATE)
     1.7 -	set -e ; __repo=$(XEN_LINUX_HGREPO) ; \
     1.8 -	if [ ! -d $(LINUX_SRCDIR) ] ; then \
     1.9 -	    echo "Cloning $${__repo} to $(LINUX_SRCDIR)." ; \
    1.10 -	    $(HG) clone $${__repo} $(LINUX_SRCDIR) ; \
    1.11 +	set -e ; \
    1.12 +	if [ ! -e $(LINUX_SRCDIR)/.hg ] ; then \
    1.13 +	    __repo=$(XEN_LINUX_HGREPO) ; \
    1.14 +	    if [ -d $${__repo} ] ; then \
    1.15 +	        echo "Linking $${__repo} to $(LINUX_SRCDIR)." ; \
    1.16 +	        ln -s $${__repo} $(LINUX_SRCDIR) ; \
    1.17 +	    else \
    1.18 +	        echo "Cloning $${__repo} to $(LINUX_SRCDIR)." ; \
    1.19 +	        $(HG) clone $${__repo} $(LINUX_SRCDIR) ; \
    1.20 +	    fi ; \
    1.21  	else \
    1.22 -	    echo "Pulling changes from $${__repo} into $(LINUX_SRCDIR)." ; \
    1.23 -	    $(HG) -R $(LINUX_SRCDIR) pull $${__repo} ; \
    1.24 +	    __parent=$$($(HG) -R $(LINUX_SRCDIR) path default) ; \
    1.25 +	    echo "Pulling changes from $${__parent} into $(LINUX_SRCDIR)." ; \
    1.26 +	    $(HG) -R $(LINUX_SRCDIR) pull $${__parent} ; \
    1.27  	fi
    1.28  	if [ -n "$(XEN_LINUX_HGREV)" ] ; then \
    1.29  	    echo "Updating $(LINUX_SRCDIR) to revision $(XEN_LINUX_HGREV)." ; \
    1.30 -	    $(HG) update -R $(LINUX_SRCDIR) $(XEN_LINUX_HGREV) ; \
    1.31 +	    ( cd $(LINUX_SRCDIR) && $(HG) update $(XEN_LINUX_HGREV) ); \
    1.32  	fi
    1.33  	touch $@
    1.34