aboutsummaryrefslogtreecommitdiffstats
path: root/buildconfigs/select-repository
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/select-repository
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/select-repository')
-rwxr-xr-xbuildconfigs/select-repository49
1 files changed, 49 insertions, 0 deletions
diff --git a/buildconfigs/select-repository b/buildconfigs/select-repository
new file mode 100755
index 0000000000..db46049adb
--- /dev/null
+++ b/buildconfigs/select-repository
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+ME=$(basename $0)
+
+if [ $# -lt 1 ] || [ $# -gt 2 ] ; then
+ echo "usage: $ME <repository-name> [search-path]" 1>&2
+ exit 1;
+fi
+
+REPO=$1
+LINUX_SRC_PATH=$2
+
+if [ X"${LINUX_SRC_PATH}" != X ] ; then
+ echo "$ME: Searching \`${LINUX_SRC_PATH}' for $REPO" 1>&2
+ IFS_saved="$IFS"
+ IFS=:
+ for i in $LINUX_SRC_PATH ; do
+ # Ignore current directory since we will almost certainly find
+ # the target directory there which breaks updating (there's no
+ # point updating from yourself!).
+ if [ X"." = X"${i}" ] ; then
+ echo "$ME: Ignoring \`.'" 1>&2
+ continue
+ fi
+
+ if [ -d "$i/$REPO/.hg" ] ; then
+ echo "$ME: Found $i/$REPO" 1>&2
+ echo "$i/$REPO"
+ exit 0
+ fi
+ done
+ IFS="$IFS_saved"
+fi
+
+XEN=$(hg -R ${XEN_ROOT} path default)
+if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
+ echo "$ME: Unable to determine Xen repository parent." 1>&2
+ exit 1;
+fi
+
+BASE=$(dirname ${XEN})
+if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
+ echo "$ME: Unable to determine Xen repository parent." 1>&2
+ exit 1;
+fi
+
+echo "$ME: Found ${BASE}/${REPO}" 1>&2
+echo ${BASE}/${REPO}
+exit 0