ia64/xen-unstable
changeset 439:76eba4e532dd
bitkeeper revision 1.221 (3eba8f8dgXua1A_xKfhWMGYPP8YLPQ)
lndir-rel:
new file
mkbuildtree:
Fixed xenolinux mkbuildtree script to create relative symlinks.
lndir-rel:
new file
mkbuildtree:
Fixed xenolinux mkbuildtree script to create relative symlinks.
author | kaf24@scramble.cl.cam.ac.uk |
---|---|
date | Thu May 08 17:10:37 2003 +0000 (2003-05-08) |
parents | f852e2cc6f5c |
children | 91f49ffad7d5 |
files | .rootkeys xenolinux-2.4.21-pre4-sparse/lndir-rel xenolinux-2.4.21-pre4-sparse/mkbuildtree |
line diff
1.1 --- a/.rootkeys Thu May 08 15:01:20 2003 +0000 1.2 +++ b/.rootkeys Thu May 08 17:10:37 2003 +0000 1.3 @@ -480,6 +480,7 @@ 3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux 1.4 3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.21-pre4-sparse/include/linux/sunrpc/debug.h 1.5 3e5a4e68W_hpMlM3u_-QOKMp3gzcwQ xenolinux-2.4.21-pre4-sparse/init/do_mounts.c 1.6 3e5a4e68TJJavrunYwTAnLRSBxSYqQ xenolinux-2.4.21-pre4-sparse/kernel/panic.c 1.7 +3eba8f878XjouY21EkQBXwYBsPsipQ xenolinux-2.4.21-pre4-sparse/lndir-rel 1.8 3e6e7c1efbQe93xCvOpOVCnXTMmQ5w xenolinux-2.4.21-pre4-sparse/mkbuildtree 1.9 3e5a4e68GxCIaFH4sy01v1wjapetaA xenolinux-2.4.21-pre4-sparse/mm/memory.c 1.10 3e5a4e681xMPdF9xCMwpyfuYMySU5g xenolinux-2.4.21-pre4-sparse/mm/mremap.c
2.1 Binary file xenolinux-2.4.21-pre4-sparse/lndir-rel has changed
3.1 --- a/xenolinux-2.4.21-pre4-sparse/mkbuildtree Thu May 08 15:01:20 2003 +0000 3.2 +++ b/xenolinux-2.4.21-pre4-sparse/mkbuildtree Thu May 08 17:10:37 2003 +0000 3.3 @@ -1,33 +1,92 @@ 3.4 +#!/bin/sh 3.5 + 3.6 # mkbuildtree <build tree> 3.7 # 3.8 # Creates symbolic links in <build tree> for the sparse tree 3.9 # in the current directory. 3.10 3.11 +# Script to determine the relative path between two directories. 3.12 +# Copyright (c) D. J. Hawkey Jr. 2002 3.13 +# Fixed for Xen project by K. Fraser in 2003. 3.14 +abs_to_rel () 3.15 +{ 3.16 + local CWD SRCPATH 3.17 + 3.18 + if [ "$1" != "/" -a "${1##*[^/]}" = "/" ]; then 3.19 + SRCPATH=${1%?} 3.20 + else 3.21 + SRCPATH=$1 3.22 + fi 3.23 + if [ "$2" != "/" -a "${2##*[^/]}" = "/" ]; then 3.24 + DESTPATH=${2%?} 3.25 + else 3.26 + DESTPATH=$2 3.27 + fi 3.28 + 3.29 + CWD=$PWD 3.30 + [ "${1%%[^/]*}" != "/" ] && cd $1 && SRCPATH=$PWD 3.31 + [ "${2%%[^/]*}" != "/" ] && cd $2 && DESTPATH=$PWD 3.32 + [ "$CWD" != "$PWD" ] && cd $CWD 3.33 + 3.34 + BASEPATH=$SRCPATH 3.35 + 3.36 + [ "$SRCPATH" = "$DESTPATH" ] && DESTPATH="." && return 3.37 + [ "$SRCPATH" = "/" ] && DESTPATH=${DESTPATH#?} && return 3.38 + 3.39 + while [ "$BASEPATH/" != "${DESTPATH%${DESTPATH#$BASEPATH/}}" ]; do 3.40 + BASEPATH=${BASEPATH%/*} 3.41 + done 3.42 + 3.43 + SRCPATH=${SRCPATH#$BASEPATH} 3.44 + DESTPATH=${DESTPATH#$BASEPATH} 3.45 + DESTPATH=${DESTPATH#?} 3.46 + while [ -n "$SRCPATH" ]; do 3.47 + SRCPATH=${SRCPATH%/*} 3.48 + DESTPATH="../$DESTPATH" 3.49 + done 3.50 + 3.51 + [ -z "$BASEPATH" ] && BASEPATH="/" 3.52 + [ "${DESTPATH##*[^/]}" = "/" ] && DESTPATH=${DESTPATH%?} 3.53 +} 3.54 + 3.55 + 3.56 [ "$1" == "" ] && { echo "Syntax: $0 <linux tree to xenify>"; exit 1; } 3.57 3.58 # Get absolute path to the destination directory 3.59 pushd . >/dev/null 3.60 cd ${1} 3.61 -D=`pwd` 3.62 +AD=`pwd` 3.63 popd >/dev/null 3.64 3.65 +# Get absolute path to the source directory 3.66 +AS=`pwd` 3.67 + 3.68 +# Get path to source, relative to destination 3.69 +abs_to_rel ${AD} ${AS} 3.70 +RS=$DESTPATH 3.71 + 3.72 # Remove old copies of files and directories at the destination 3.73 -for i in `find -type f -o -type l` ; do rm -f ${D}/${i#./} ; done 3.74 +for i in `find . -type f -o -type l` ; do rm -f ${AD}/${i#./} ; done 3.75 + 3.76 +# We now work from the destination directory 3.77 +cd ${AD} 3.78 3.79 # Create symlinks of files and directories which exist in the sparse source 3.80 -lndir -silent -ignorelinks `pwd` ${D} 3.81 -rm -f ${D}/mkbuildtree 3.82 +${AS}/lndir-rel -silent ${RS} 3.83 +rm -f mkbuildtree lndir-rel 3.84 3.85 ## There are a whole bunch of special symlinks, mostly for files 3.86 ## which are identical in the i386 and xeno-i386 architecture-dependent 3.87 ## subdirectories. 3.88 3.89 # This first symlink is special: it links to shared files in Xen's source tree 3.90 -rm -f ${D}/include/asm-xeno/hypervisor-ifs 3.91 -ln -sf `pwd`/../xen/include/hypervisor-ifs ${D}/include/asm-xeno/hypervisor-ifs 3.92 +rm -f ${AD}/include/asm-xeno/hypervisor-ifs 3.93 +mkdir ${AD}/include/asm-xeno/hypervisor-ifs 3.94 +cd ${AD}/include/asm-xeno/hypervisor-ifs 3.95 +${AS}/lndir-rel -silent ../../../${RS}/../xen/include/hypervisor-ifs 3.96 3.97 # The remainder are the i386 -> xeno-i386 links 3.98 -cd ${D}/include/asm-xeno 3.99 +cd .. 3.100 ln -sf ../asm-i386/a.out.h 3.101 ln -sf ../asm-i386/apicdef.h 3.102 ln -sf ../asm-i386/apic.h