summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2004-10-24 22:54:25 +0000
committeragc <agc@pkgsrc.org>2004-10-24 22:54:25 +0000
commita920ff2b3c49d4ec977a433441d7b23f6b7f9598 (patch)
tree9dc7d33f089460359047330a08ecb2cdc24dff6d /mk
parentb99ef9d0b3ba3a62b9d495f961c60dec6f4c8d4a (diff)
downloadpkgsrc-a920ff2b3c49d4ec977a433441d7b23f6b7f9598.tar.gz
Allow the xsrc directory to be specified on the command line, defaulting to
/usr/xsrc if not specified, and check for its existence.
Diffstat (limited to 'mk')
-rwxr-xr-xmk/bulk/mksandbox17
1 files changed, 14 insertions, 3 deletions
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox
index 88aabe71d6b..f79ab772e60 100755
--- a/mk/bulk/mksandbox
+++ b/mk/bulk/mksandbox
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: mksandbox,v 1.37 2004/09/16 09:55:42 cjep Exp $
+# $NetBSD: mksandbox,v 1.38 2004/10/24 22:54:25 agc Exp $
#
#
# Copyright (c) 2002 Alistair G. Crooks. All rights reserved.
@@ -34,13 +34,14 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-# Usage: mksandbox [--pkgsrc=dir] [--src=srcdir] [--verbose] sandbox-dir
+# Usage: mksandbox [--pkgsrc=dir] [--src=srcdir] [--xsrc=xsrcdir] [--verbose] sandbox-dir
#
# A small shell script to set up a sandbox (usually for a pkgsrc bulk
# build), using null mounts.
pkgsrc=/usr/pkgsrc
src=/usr/src
+xsrc=/usr/xsrc
kernel=""
sandboxMountDirs="/bin /sbin /lib /libexec /usr/X11R6 /usr/bin /usr/games /usr/include /usr/lib /usr/libdata /usr/libexec /usr/lkm /usr/share /usr/sbin /var/mail"
@@ -49,7 +50,7 @@ sandboxEmptyFiles="/var/run/utmp /var/run/utmpx /var/log/wtmp /var/log/wtmpx /va
usage()
{
- echo "Usage: mksandbox [--pkgsrc=dir] [--src=srcdir] [--verbose] sandbox-dir"
+ echo "Usage: mksandbox [--pkgsrc=dir] [--src=srcdir] [--xsrc=xsrcdir] [--verbose] sandbox-dir"
exit 1
}
@@ -137,6 +138,7 @@ while [ $# -gt 0 ]; do
case "$1" in
--pkgsrc=*) pkgsrc=`echo $1 | $sedprog -e 's|^--pkgsrc=||'` ;;
--src=*) src=`echo $1 | $sedprog -e 's|^--src=||'` ;;
+ --xsrc=*) xsrc=`echo $1 | $sedprog -e 's|^--xsrc=||'` ;;
--verbose) set -x ;;
-*) usage ;;
*) break ;;
@@ -160,6 +162,10 @@ if [ ! -d $src ]; then
err "source directory $src does not exist."
fi
+if [ ! -d $xsrc ]; then
+ err "xsrc directory $xsrc does not exist."
+fi
+
sandbox=$1
sandbox_script="$sandbox/sandbox"
@@ -272,6 +278,11 @@ $mkdirprog $sandbox/usr/pkgsrc
$mountprog $mountflags $pkgsrc $sandbox/usr/pkgsrc
echo "$pkgsrc /usr/pkgsrc rw \\" >> $sandbox_script
+echo "Mount $xsrc from $sandbox"
+$mkdirprog $sandbox/usr/xsrc
+$mountprog $mountflags -r $xsrc $sandbox/usr/xsrc
+echo "$xsrc /usr/xsrc ro \\" >> $sandbox_script
+
echo "Mounting $packages and $distfiles from $sandbox"
$mkdirprog $sandbox/$packages $sandbox/$distfiles
$mkdirprog $packages $distfiles