bitkeeper revision 1.1159.258.29 (422e4382uaLzLWWGJwNl_pq0d8dMog)
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Wed, 9 Mar 2005 00:29:54 +0000 (00:29 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Wed, 9 Mar 2005 00:29:54 +0000 (00:29 +0000)
Support Xen-ifying a complete NetBSD source tree.
Signed-off-by: Christian Limpach <cl@NetBSD.org>
netbsd-2.0-xen-sparse/mkbuildtree

index 0d5330d115e3db51ff045186b535ea43d6c3121e..ef85a8922afdd8614c0a8f0079e0b6d04df32a20 100755 (executable)
@@ -85,6 +85,9 @@ popd >/dev/null
 # Get absolute path to the source directory
 AS=`pwd`
 
+# Get name of sparse directory
+SDN=$(basename $AS)
+
 # Get path to source, relative to destination
 abs_to_rel ${AD} ${AS}
 RS=$DESTPATH
@@ -96,12 +99,23 @@ for i in `find . -type f -o -type l` ; do rm -f ${AD}/${i#./} ; done
 cd ${AD}
 
 # Remove old symlinks
-for i in `find . -type l`; do rm -f $i; done
-
-# Create symlinks of files and directories which exist in the sparse source
-relative_lndir ${RS}
-rm -f mkbuildtree
-
+find sys -type l | while read f
+do
+  case $(readlink $f) in
+  */$SDN/*)
+    rm -f $f
+    ;;
+  esac
+done
+
+if [ -f ${AD}/BUILDING ]; then
+  # Create symlinks of files and directories which exist in the sparse source
+  (cd sys && relative_lndir ../${RS}/sys)
+else
+  # Create symlinks of files and directories which exist in the sparse source
+  relative_lndir ${RS}
+  rm -f mkbuildtree
+fi
 
 # Create links to the shared definitions of the Xen interface
 rm -rf ${AD}/sys/arch/xen/include/xen-public