svn commit: r244519 - projects/portbuild/tools
Mark Linimon
linimon at FreeBSD.org
Thu Dec 20 22:49:14 UTC 2012
Author: linimon (doc,ports committer)
Date: Thu Dec 20 22:49:14 2012
New Revision: 244519
URL: http://svnweb.freebsd.org/changeset/base/244519
Log:
Make it actually work.
Modified:
projects/portbuild/tools/mkportbuild
Modified: projects/portbuild/tools/mkportbuild
==============================================================================
--- projects/portbuild/tools/mkportbuild Thu Dec 20 22:49:04 2012 (r244518)
+++ projects/portbuild/tools/mkportbuild Thu Dec 20 22:49:14 2012 (r244519)
@@ -6,11 +6,11 @@
# Designed to be run before anything else.
#
-DEFAULT_PORTBUILD_USER=portbuild
-DEFAULT_VCS_CHECKOUT_COMMAND=svn checkout
-DEFAULT_VCS_REPOSITORY=svn://svn.FreeBSD.org
-DEFAULT_ZFS_VOLUME=a
-DEFAULT_ZFS_PERMISSIONSET=clone,create,destroy,mount,promote,rename,rollback,send,share,snapshot
+DEFAULT_PORTBUILD_USER="portbuild"
+DEFAULT_VCS_CHECKOUT_COMMAND="svn checkout"
+DEFAULT_VCS_REPOSITORY="svn://svn.FreeBSD.org"
+DEFAULT_ZFS_VOLUME="a"
+DEFAULT_ZFS_PERMISSIONSET="clone,create,destroy,mount,promote,rename,rollback,send,share,snapshot"
if [ `id -u` != 0 ]; then
echo "$0 must be run as root."
@@ -22,7 +22,7 @@ if [ -z "${PORTBUILD_USER}" ]; then
exit 1
fi
if [ -z "${VCS_CHECKOUT_COMMAND}" ]; then
- VCS_CHECKOUT_COMMAND=${DEFAULT_VCS_CHECKOUT_COMMAND}
+ VCS_CHECKOUT_COMMAND="${DEFAULT_VCS_CHECKOUT_COMMAND}"
fi
if [ -z "${VCS_PORTBUILD_REPOSITORY}" ]; then
echo "You have not set VCS_PORTBUILD_REPOSITORY. I will try to set it from VCS_REPOSITORY."
@@ -30,7 +30,7 @@ if [ -z "${VCS_PORTBUILD_REPOSITORY}" ];
echo "You have not set VCS_REPOSITORY. I will use the default, ${DEFAULT_VCS_REPOSITORY}."
VCS_REPOSITORY=${DEFAULT_VCS_REPOSITORY}
fi
- VCS_PORTBUILD_REPOSITORY=${VCS_REPOSITORY}/base/projects/portbuild
+ VCS_PORTBUILD_REPOSITORY="${VCS_REPOSITORY}/base/projects/portbuild"
fi
if [ -z "${ZFS_VOLUME}" ]; then
echo "You must export ZFS_VOLUME, for example, export ZFS_VOLUME=${DEFAULT_ZFS_VOLUME}."
@@ -39,6 +39,7 @@ fi
ZFS_MOUNTPOINT="/${ZFS_VOLUME}"
if [ -z "${ZFS_PERMISSIONSET}" ]; then
echo "You have not set ZFS_PERMISSIONSET. I will use the default, ${DEFAULT_ZFS_PERMISSIONSET}."
+ ZFS_PERMISSIONSET="${DEFAULT_ZFS_PERMISSIONSET}"
fi
# XXX MCL copy to setup instructions
@@ -47,12 +48,12 @@ sysctl vfs.usermount=1
sysctl vfs.zfs.super_owner=1
name=`zfs list -H -t filesystem -o name ${ZFS_VOLUME}`
-if [ ! -z "${name}" ]; then
+if [ -z "${name}" ]; then
echo "ZFS volume ${ZFS_VOLUME} does not exist. You must create it first."
exit 1
fi
mountpoint=`zfs list -H -t filesystem -o mountpoint ${ZFS_VOLUME}`
-if [ ! -z "${mountpoint}" ]; then
+if [ -z "${mountpoint}" ]; then
echo "ZFS volume ${ZFS_VOLUME} is not mounted. I'll mount it for you."
zfs mount ${ZFS_VOLUME} || exit 1
fi
@@ -74,9 +75,11 @@ zfs list ${ZFS_VOLUME}
zfs allow ${ZFS_VOLUME}
# create a place to hold the repository
-su -m ${PORTBUILD_USER} -c "zfs create ${ZFS_VOLUME}/portbuild" || exit 1
+if [ ! -d ${ZFS_MOUNTPOINT}/portbuild ]; then
+ su -m ${PORTBUILD_USER} -c "zfs create ${ZFS_VOLUME}/portbuild" || exit 1
+fi
echo "checking out the repository ..."
-${VCS_CHECKOUT_COMMAND} ${VCS_PORTBUILD_REPOSITORY} ${ZFS_MOUNTPOINT}/portbuild || exit 1
+su -m ${PORTBUILD_USER} -c "${VCS_CHECKOUT_COMMAND} ${VCS_PORTBUILD_REPOSITORY} ${ZFS_MOUNTPOINT}/portbuild" || exit 1
echo "$0: done. You should now be able to edit files in ${ZFS_MOUNTPOINT}/portbuild/conf."
More information about the svn-src-projects
mailing list