pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/bulk + Skip mounting X11 directories if --without-x...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/af42406143e3
branches:  trunk
changeset: 540196:af42406143e3
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Apr 01 16:30:19 2008 +0000

description:
+ Skip mounting X11 directories if --without-x is specified.

+ Add a "chroot" option, stolen from pkg_comp(8) that starts a root
  shell with a better environment setup.

diffstat:

 mk/bulk/mksandbox |  17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diffs (40 lines):

diff -r 48fb6d0ffd99 -r af42406143e3 mk/bulk/mksandbox
--- a/mk/bulk/mksandbox Tue Apr 01 16:21:29 2008 +0000
+++ b/mk/bulk/mksandbox Tue Apr 01 16:30:19 2008 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# $NetBSD: mksandbox,v 1.49 2008/04/01 16:06:35 jlam Exp $
+# $NetBSD: mksandbox,v 1.50 2008/04/01 16:30:19 jlam Exp $
 #
 #
 # Copyright (c) 2002 Alistair G. Crooks.  All rights reserved.
@@ -266,6 +266,9 @@
 echo "Make empty dirs upon which to mount the null mounts"
 for d in $sandboxMountDirs; do
        test -d $d || continue;
+       case $d in
+       *X11*)  test "$with_x" = "yes" || continue ;;
+       esac
        $mkdirprog $sandbox$d;
        $mountprog $mountflags -r $d $sandbox$d;
        echo "$d $d ro \\" >> $sandbox_script
@@ -352,6 +355,18 @@
                umount \$sandbox/\$mntpoint
        done
        ;;
+       xchroot)
+       case x\$2 in
+       x)      rootshell=/bin/ksh ;;
+       *)      rootshell="\$2" ;;
+       esac
+       script="$sandbox/tmp/script.\$\$"
+       echo "#!/bin/sh" > \$script
+       echo "ENV=/etc/shrc \$rootshell" >> \$script
+       chmod +x \$script
+       ENV=/etc/shrc chroot \$sandbox /tmp/\`basename \$script\`
+       rm -f \$script
+       ;;
        *)
        if [ \$# -eq 0 ]; then
                set dummy /bin/sh



Home | Main Index | Thread Index | Old Index