direct-io.hg

view buildconfigs/select-repository @ 15516:fa9fa5f98c91

Simplify Unisys ES7000 code in light of the fact we do not support
legacy boxes with very non-standard APIC setup.
From: Raj Subrahmanian <raj.subrahmanian@unisys.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Jul 10 10:07:00 2007 +0100 (2007-07-10)
parents faef0f795490
children
line source
1 #!/bin/sh
3 ME=$(basename $0)
5 if [ $# -lt 1 ] || [ $# -gt 2 ] ; then
6 echo "usage: $ME <repository-name> [search-path]" 1>&2
7 exit 1;
8 fi
10 REPO=$1
11 LINUX_SRC_PATH=$2
13 if [ X"${LINUX_SRC_PATH}" != X ] ; then
14 echo "$ME: Searching \`${LINUX_SRC_PATH}' for $REPO" 1>&2
15 IFS_saved="$IFS"
16 IFS=:
17 for i in $LINUX_SRC_PATH ; do
18 # Ignore current directory since we will almost certainly find
19 # the target directory there which breaks updating (there's no
20 # point updating from yourself!).
21 if [ X"." = X"${i}" ] ; then
22 echo "$ME: Ignoring \`.'" 1>&2
23 continue
24 fi
26 if [ -d "$i/$REPO/.hg" ] ; then
27 echo "$ME: Found $i/$REPO" 1>&2
28 echo "$i/$REPO"
29 exit 0
30 fi
31 done
32 IFS="$IFS_saved"
33 fi
35 XEN=$(hg -R ${XEN_ROOT} path default)
36 if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
37 echo "$ME: Unable to determine Xen repository parent." 1>&2
38 exit 1;
39 fi
41 BASE=$(dirname ${XEN})
42 if [ $? -ne 0 ] || [ X"$BASE" = "X" ] ; then
43 echo "$ME: Unable to determine Xen repository base." 1>&2
44 exit 1;
45 fi
46 if [ -d "$XEN" ] && [ ! -d "$BASE/$REPO" ] ; then
47 echo "$ME: No such dir: $BASE/$REPO" 1>&2
48 exit 1
49 fi
51 echo "$ME: Found ${BASE}/${REPO}" 1>&2
53 # If ${BASE}/${REPO} is a local directory then prepend file:// so that
54 # the test in src.hg-clone will fail and we will clone instead of
55 # linking this repository. We only want to link repositories which
56 # were found via LINUX_SRC_PATH.
57 if [ -d "${BASE}/${REPO}" ] ; then
58 echo "file://${BASE}/${REPO}"
59 else
60 echo ${BASE}/${REPO}
61 fi
62 exit 0