svn commit: r246681 - projects/portbuild/admin/tools

Mark Linimon linimon at FreeBSD.org
Mon Feb 11 14:45:42 UTC 2013


Author: linimon (doc,ports committer)
Date: Mon Feb 11 14:45:41 2013
New Revision: 246681
URL: http://svnweb.freebsd.org/changeset/base/246681

Log:
  Fix the test for whether the portbuild zpool exists.  While here, add
  some more armor-plating.

Modified:
  projects/portbuild/admin/tools/newmkportbuild

Modified: projects/portbuild/admin/tools/newmkportbuild
==============================================================================
--- projects/portbuild/admin/tools/newmkportbuild	Mon Feb 11 14:32:06 2013	(r246680)
+++ projects/portbuild/admin/tools/newmkportbuild	Mon Feb 11 14:45:41 2013	(r246681)
@@ -27,10 +27,19 @@ if [ -z "${PORTBUILD_USER}" ]; then
   echo "You must export PORTBUILD_USER, for example, export PORTBUILD_USER=${DEFAULT_PORTBUILD_USER}."
   exit 1
 fi
+if [ ! `id ${PORTBUILD_USER} 2> /dev/null` ]; then
+  echo "User ${PORTBUILD_USER} must exist."
+  exit 1
+fi
 if [ -z "${SRCBUILD_USER}" ]; then
   echo "You must export SRCBUILD_USER, for example, export SRCBUILD_USER=${DEFAULT_SRCBUILD_USER}."
   exit 1
 fi
+if [ ! `id ${SRCBUILD_USER} 2> /dev/null` ]; then
+  echo "User ${SRCBUILD_USER} must exist."
+  exit 1
+fi
+
 if [ -z "${VCS_CHECKOUT_COMMAND}" ]; then
   VCS_CHECKOUT_COMMAND="${DEFAULT_VCS_CHECKOUT_COMMAND}"
 fi
@@ -74,7 +83,8 @@ fi
 
 # create a place to hold all portbuild-managed files.  All other ZFS_VOLUME
 # files are managed by srcbuild.
-if [ ! -d ${ZFS_MOUNTPOINT}/portbuild ]; then
+name=`zfs list -H -t filesystem -o name ${ZFS_VOLUME}/portbuild`
+if [ -z "${name}" ]; then
   echo "ZFS volume ${ZFS_VOLUME}/portbuild does not exist.  I'll create it for you."
   zfs create ${ZFS_VOLUME}/portbuild || exit 1
 fi


More information about the svn-src-projects mailing list