From owner-svn-src-projects@FreeBSD.ORG  Sat Dec 29 17:41:51 2012
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
 by hub.freebsd.org (Postfix) with ESMTP id 61AAB2D1;
 Sat, 29 Dec 2012 17:41:51 +0000 (UTC)
 (envelope-from linimon@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org
 [IPv6:2001:1900:2254:2068::e6a:0])
 by mx1.freebsd.org (Postfix) with ESMTP id 2CD158FC12;
 Sat, 29 Dec 2012 17:41:51 +0000 (UTC)
Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70])
 by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBTHfpTg017342;
 Sat, 29 Dec 2012 17:41:51 GMT (envelope-from linimon@svn.freebsd.org)
Received: (from linimon@localhost)
 by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBTHfpxh017341;
 Sat, 29 Dec 2012 17:41:51 GMT (envelope-from linimon@svn.freebsd.org)
Message-Id: <201212291741.qBTHfpxh017341@svn.freebsd.org>
From: Mark Linimon <linimon@FreeBSD.org>
Date: Sat, 29 Dec 2012 17:41:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject: svn commit: r244825 - projects/portbuild/tools
X-SVN-Group: projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
 tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
 <mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 29 Dec 2012 17:41:51 -0000

Author: linimon (doc,ports committer)
Date: Sat Dec 29 17:41:50 2012
New Revision: 244825
URL: http://svnweb.freebsd.org/changeset/base/244825

Log:
  Teach this the right way of doing zfs delegation.  While here, add the
  loads/ subdirectory, and clean out cruft.

Modified:
  projects/portbuild/tools/addarch

Modified: projects/portbuild/tools/addarch
==============================================================================
--- projects/portbuild/tools/addarch	Sat Dec 29 16:33:32 2012	(r244824)
+++ projects/portbuild/tools/addarch	Sat Dec 29 17:41:50 2012	(r244825)
@@ -58,34 +58,23 @@ else
     gid=${uid}
 fi
 
-# create arch-specific directory if it does not already exist.
-# Exit if it is not manageable by uid:gid.
-archdir=${pbd}/${arch}
-if [ ! -d ${archdir} ]; then
-  echo "The ${archdir} directory does not exist.  I'll create it for you."
-  mkdir -p ${archdir} || exit 1
-  chown -R ${uid}:${gid} ${archdir} || exit 1
-  chmod 775 ${archdir} || exit 1
-fi
-
 # create zfs instance for arch if it does not already exist.  (duplicates 'build')
+archdir=${pbd}/${arch}
 archfs=${ZFS_VOLUME}/portbuild/${arch}
-mountpoint=$(realpath ${archdir})
 if ! test_fs "${archfs}"; then
   echo "The ${archfs} filesystem does not exist.  I'll create and mount it for you."
-  zfs create -o mountpoint=${mountpoint} ${archfs} || exit 1
+  zfs create ${archfs} || exit 1
   chown -R ${uid}:${gid} ${archdir} || exit 1
   chmod -R g+w ${archdir} || exit 1
 fi
 
-## create .ssh/ directory if it does not already exist.  (duplicates 'build')
-#sshdir=${archdir}/.ssh
-#if [ ! -d ${sshdir} ]; then
-#  echo "The ${sshdir} directory does not exist.  I'll create it for you, but you will need to populate it."
-#  mkdir -p ${sshdir} || exit 1
-#  chown -R ${uid}:${gid} ${sshdir} || exit 1
-#  chmod 700 ${sshdir} || exit 1
-#fi
+loads=${archdir}/loads
+if [ ! -d ${loads} ]; then
+  echo "The ${loads} directory does not exist.  I'll create it for you."
+  mkdir -p ${loads} || exit 1
+  chown -R ${uid}:${gid} ${loads} || exit 1
+  chmod -R g+w ${loads} || exit 1
+fi
 
 lockfiles=${archdir}/lockfiles
 if [ ! -d ${lockfiles} ]; then