WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] buildconfigs/src.git-clone: use git clone, avoid git

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] buildconfigs/src.git-clone: use git clone, avoid git remote
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Thu, 18 Jun 2009 14:46:33 +0100
Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Delivery-date: Thu, 18 Jun 2009 06:47:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
git 1.4.x (which is on even some moderately recent systems) doesn't
have the `git remote' command.  This is what caused the most recent
patchman build failure.

The machinery in buildconfigs/src.git-clone was rather more
complicated than needed, too.  In this patch I replace this with a
similar set of runes to those used for ioemu-remote (almost identical
except that the QEMU_TAG feature is not supported in this instance).

I have done a successful test build with this change.

Cc: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 61ec78692b13 buildconfigs/mk.linux-2.6-pvops
--- a/buildconfigs/mk.linux-2.6-pvops   Wed Jun 17 07:39:27 2009 +0100
+++ b/buildconfigs/mk.linux-2.6-pvops   Wed Jun 17 16:37:08 2009 +0100
@@ -6,7 +6,6 @@ XEN_LINUX_CONFIG_UPDATE := buildconfigs/
 XEN_LINUX_CONFIG_UPDATE := buildconfigs/enable-xen-config
 
 XEN_LINUX_GIT_URL ?= 
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git
-XEN_LINUX_GIT_REMOTENAME ?= xen
 XEN_LINUX_GIT_REMOTEBRANCH ?= xen-tip/master
 
 EXTRAVERSION ?=
diff -r 61ec78692b13 buildconfigs/mk.linux-2.6-tip-latest
--- a/buildconfigs/mk.linux-2.6-tip-latest      Wed Jun 17 07:39:27 2009 +0100
+++ b/buildconfigs/mk.linux-2.6-tip-latest      Wed Jun 17 16:37:08 2009 +0100
@@ -6,7 +6,6 @@ XEN_LINUX_CONFIG_UPDATE := buildconfigs/
 XEN_LINUX_CONFIG_UPDATE := buildconfigs/enable-xen-config
 
 XEN_LINUX_GIT_URL ?= 
git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-tip.git
-XEN_LINUX_GIT_REMOTENAME ?= x86
 XEN_LINUX_GIT_REMOTEBRANCH ?= auto-latest
 
 EXTRAVERSION ?=
diff -r 61ec78692b13 buildconfigs/src.git-clone
--- a/buildconfigs/src.git-clone        Wed Jun 17 07:39:27 2009 +0100
+++ b/buildconfigs/src.git-clone        Thu Jun 18 14:03:08 2009 +0100
@@ -7,9 +7,6 @@ ifeq ($(XEN_LINUX_GIT_URL),)
 ifeq ($(XEN_LINUX_GIT_URL),)
 .ERROR: XEN_LINUX_GIT_URL not specified
 endif
-
-# The name to use for the remote repository
-XEN_LINUX_GIT_REMOTENAME ?= origin
 
 # The branch in the remote repository
 ifeq ($(XEN_LINUX_GIT_REMOTEBRANCH),)
@@ -22,39 +19,13 @@ XEN_LINUX_GITREV  ?=
 XEN_LINUX_GITREV  ?= 
 
 $(LINUX_SRCDIR)/.valid-src: $(__XEN_LINUX_UPDATE)
-       @set -e ; if [ -d $(LINUX_SRCDIR) ] && [ ! -d $(GIT_DIR) ] ; then \
-           echo "$(LINUX_SRCDIR) exists but is not a git repository." 1>&2 ; \
-           false ; \
+       set -ex; \
+       if ! [ -d $(LINUX_SRCDIR) ]; then \
+               rm -rf $(LINUX_SRCDIR) $(LINUX_SRCDIR).tmp; \
+               mkdir $(LINUX_SRCDIR).tmp; rmdir $(LINUX_SRCDIR).tmp; \
+               $(GIT) clone $(XEN_LINUX_GIT_URL) $(LINUX_SRCDIR).tmp; \
+               cd $(LINUX_SRCDIR).tmp; \
+               $(GIT) checkout $(XEN_LINUX_GIT_REMOTEBRANCH); \
+               cd ..; mv $(LINUX_SRCDIR).tmp $(LINUX_SRCDIR); \
        fi
-
-       @set -e ; if [ ! -e $(LINUX_SRCDIR)/.git ] ; then \
-           mkdir $(LINUX_SRCDIR) ; \
-           cd $(LINUX_SRCDIR) ; \
-           $(GIT) init-db ; \
-       fi
-
-       @set -e ; cd $(LINUX_SRCDIR) ; \
-       if ! $(GIT) remote | grep -q $(XEN_LINUX_GIT_REMOTENAME) ; then \
-           echo "Adding remote git repository \`$(XEN_LINUX_GIT_URL)' as 
\`$(XEN_LINUX_GIT_REMOTENAME)'" ; \
-           $(GIT) remote add $(XEN_LINUX_GIT_REMOTENAME) $(XEN_LINUX_GIT_URL) 
; \
-       fi
-
-       @echo "Updating remote \`$(XEN_LINUX_GIT_REMOTENAME)'"
-       @cd $(LINUX_SRCDIR) && $(GIT) fetch $(XEN_LINUX_GIT_REMOTENAME)
-
-       @set -e ; cd $(LINUX_SRCDIR) ; \
-       if ! $(GIT) branch -l | grep -q $(XEN_LINUX_GIT_LOCALBRANCH) ; then \
-           $(GIT) branch --track $(XEN_LINUX_GIT_LOCALBRANCH) \
-               $(XEN_LINUX_GIT_REMOTENAME)/$(XEN_LINUX_GIT_REMOTEBRANCH) ; \
-           $(GIT) checkout ; \
-       fi
-
-       @ set -e ; cd $(LINUX_SRCDIR) ; \
-       if [ -n "$(XEN_LINUX_GITREV)" ] ; then \
-           echo "Updating $(LINUX_SRCDIR) to revision \'$(XEN_LINUX_GITREV)'." 
; \
-           $(GIT) reset --hard $(XEN_LINUX_GITREV) ; \
-       else \
-           $(GIT) reset --hard 
$(XEN_LINUX_GIT_REMOTENAME)/$(XEN_LINUX_GIT_REMOTEBRANCH) ; \
-       fi
-
        touch $@

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] buildconfigs/src.git-clone: use git clone, avoid git remote, Ian Jackson <=