svn commit: r246740 - in projects/portbuild: scripts tools
Mark Linimon
linimon at FreeBSD.org
Wed Feb 13 03:23:14 UTC 2013
Author: linimon (doc,ports committer)
Date: Wed Feb 13 03:23:12 2013
New Revision: 246740
URL: http://svnweb.freebsd.org/changeset/base/246740
Log:
From production: properly reflect the refactoring of parts of
conf/server.conf into admin/conf/admin.conf.
While here, remove excess chown/chmod invocations which a) no longer
make sense, and b) take a long time to do their unneeded work.
Modified:
projects/portbuild/scripts/build
projects/portbuild/scripts/dopackages
projects/portbuild/scripts/dopackagestats
projects/portbuild/scripts/processfail
projects/portbuild/scripts/processlogs
projects/portbuild/scripts/stats
projects/portbuild/tools/addarch
Modified: projects/portbuild/scripts/build
==============================================================================
--- projects/portbuild/scripts/build Wed Feb 13 03:21:04 2013 (r246739)
+++ projects/portbuild/scripts/build Wed Feb 13 03:23:12 2013 (r246740)
@@ -56,42 +56,32 @@ do_create() {
# not manageable by uid:gid.
archdir=${pbd}/${arch}
if [ ! -d ${archdir} ]; then
- echo "${archdir} must exist and be owned by ${uid}:${gid} mode 77x."
+ echo "${archdir} must exist."
exit 1
fi
- chown -R ${uid}:${gid} ${archdir} || exit 1
- chmod 775 ${archdir} || exit 1
# create zfs instance for arch if it does not already exist
archfs=${ZFS_VOLUME}/portbuild/${arch}
if ! test_fs "${archfs}"; then
zfs create ${archfs} || exit 1
- #chown -R ${uid}:${gid} ${archdir}
- #chmod -R g+w ${archdir}
fi
# create overall archive directory if it does not already exist
archivedir=${pbd}/${arch}/archive
if [ ! -d ${archivedir} ]; then
mkdir -p ${archivedir} || exit 1
- chown -R ${uid}:${gid} ${archivedir}
- chmod -R g+w ${archivedir}
fi
# create archive directory for all build logs if it does not already exist
buildlogsdir=${archivedir}/buildlogs
if [ ! -d ${buildlogsdir} ]; then
mkdir -p ${buildlogsdir} || exit 1
- chown -R ${uid}:${gid} ${buildlogsdir}
- chmod -R g+w ${buildlogsdir}
fi
# create archive directory for all errorlogs if it does not already exist
errorlogsdir=${archivedir}/errorlogs
if [ ! -d ${errorlogsdir} ]; then
mkdir -p ${errorlogsdir} || exit 1
- chown -R ${uid}:${gid} ${errorlogsdir}
- chmod -R g+w ${errorlogsdir}
fi
# create zfs instance for buildenv if it does not already exist
@@ -128,44 +118,32 @@ do_create() {
clientsdir=${pbd}/${arch}/clients
if [ ! -d ${clientsdir} ]; then
mkdir -p ${clientsdir} || exit 1
- chown -R ${uid}:${gid} ${clientsdir}
- chmod -R g+w ${clientsdir}
fi
# create loads/ directory if it does not already exist
loadsdir=${pbd}/${arch}/loads
if [ ! -d ${loadsdir} ]; then
mkdir -p ${loadsdir} || exit 1
- chown -R ${uid}:${gid} ${loadsdir}
- chmod -R g+w ${loadsdir}
fi
# create lockfiles/ directory if it does not already exist
lockfiles=${pbd}/${arch}/lockfiles
if [ ! -d ${lockfiles} ]; then
mkdir -p ${lockfiles} || exit 1
- chown -R ${uid}:${gid} ${lockfiles}
- chmod -R g+w ${lockfiles}
fi
# create empty mlist file if it does not already exist
mlist=${pbd}/${arch}/mlist
if [ ! -d ${mlist} ]; then
touch ${mlist} || exit 1
- chown -R ${uid}:${gid} ${mlist}
- chmod -R g+w ${mlist}
fi
# create the links for the webserver under ../errorlogs/. Note
# possibly different ownership of this directory!
errorlogs=${pbd}/errorlogs
- portbuild_uid=${PORTBUILD_USER}
if [ ! -d ${errorlogs} ]; then
- echo "${errorlogs} must exist and be owned by ${portbuild_uid}:${gid} mode 77x."
- exit 1
+ mkdir -p ${archivedir} || exit 1
fi
- chown -R ${portbuild_uid}:${gid} ${errorlogs} || exit 1
- chmod 775 ${errorlogs} || exit 1
ln -s ${buildsdir}/latest/bak/errors ${errorlogs}/${arch}-${branch}-previous
ln -s ${buildsdir}/latest/bak/logs ${errorlogs}/${arch}-${branch}-previous-logs
@@ -547,6 +525,7 @@ arch=$2
branch=$3
shift 3
+. ${pbc}/admin/conf/admin.conf
. ${pbc}/conf/server.conf
. ${pbd}/${arch}/portbuild.conf
. ${pbc}/scripts/buildenv
@@ -555,17 +534,6 @@ pbab=${pbd}/${arch}/${branch}
validate_env ${arch} ${branch} || exit 1
-if [ ! -z "${PORTBUILD_USER}" ]; then
- uid=${PORTBUILD_USER}
-else
- uid=ports-${arch}
-fi
-if [ ! -z "${PORTBUILD_GROUP}" ]; then
- gid=${PORTBUILD_GROUP}
-else
- gid=${uid}
-fi
-
# Not every command requires a buildid as arg
if [ $# -ge 1 ]; then
buildid=$1
Modified: projects/portbuild/scripts/dopackages
==============================================================================
--- projects/portbuild/scripts/dopackages Wed Feb 13 03:21:04 2013 (r246739)
+++ projects/portbuild/scripts/dopackages Wed Feb 13 03:23:12 2013 (r246740)
@@ -51,6 +51,7 @@ buildid=$3
datestamp=$4
shift 4
+. ${pbc}/admin/conf/admin.conf
. ${pbc}/conf/server.conf
. ${pbc}/conf/common.conf
. ${pbc}/scripts/buildenv
Modified: projects/portbuild/scripts/dopackagestats
==============================================================================
--- projects/portbuild/scripts/dopackagestats Wed Feb 13 03:21:04 2013 (r246739)
+++ projects/portbuild/scripts/dopackagestats Wed Feb 13 03:23:12 2013 (r246740)
@@ -8,6 +8,7 @@
pbc=${PORTBUILD_CHECKOUT:-/var/portbuild}
pbd=${PORTBUILD_DATA:-/var/portbuild}
+. ${pbc}/admin/conf/admin.conf
. ${pbc}/conf/server.conf
here=`pwd`
Modified: projects/portbuild/scripts/processfail
==============================================================================
--- projects/portbuild/scripts/processfail Wed Feb 13 03:21:04 2013 (r246739)
+++ projects/portbuild/scripts/processfail Wed Feb 13 03:23:12 2013 (r246740)
@@ -8,6 +8,7 @@ branch=$2
pbc=${PORTBUILD_CHECKOUT:-/var/portbuild}
pbd=${PORTBUILD_DATA:-/var/portbuild}
+. ${pbc}/admin/conf/admin.conf
. ${pbc}/conf/server.conf
ERRORLOGS_DIRECTORY="${WWW_DIRECTORY}/errorlogs"
Modified: projects/portbuild/scripts/processlogs
==============================================================================
--- projects/portbuild/scripts/processlogs Wed Feb 13 03:21:04 2013 (r246739)
+++ projects/portbuild/scripts/processlogs Wed Feb 13 03:23:12 2013 (r246740)
@@ -42,6 +42,7 @@ errorscript=$scriptdir/processonelog
pbc=${PORTBUILD_CHECKOUT:-/var/portbuild}
pbd=${PORTBUILD_DATA:-/var/portbuild}
+. ${pbc}/admin/conf/admin.conf
. ${pbc}/conf/server.conf
. ${pbd}/${arch}/portbuild.conf
Modified: projects/portbuild/scripts/stats
==============================================================================
--- projects/portbuild/scripts/stats Wed Feb 13 03:21:04 2013 (r246739)
+++ projects/portbuild/scripts/stats Wed Feb 13 03:23:12 2013 (r246740)
@@ -3,6 +3,7 @@
pbc=${PORTBUILD_CHECKOUT:-/var/portbuild}
pbd=${PORTBUILD_DATA:-/var/portbuild}
+. ${pbc}/admin/conf/admin.conf
. ${pbc}/conf/server.conf
if [ $# -ne 1 ]; then
Modified: projects/portbuild/tools/addarch
==============================================================================
--- projects/portbuild/tools/addarch Wed Feb 13 03:21:04 2013 (r246739)
+++ projects/portbuild/tools/addarch Wed Feb 13 03:23:12 2013 (r246740)
@@ -28,6 +28,11 @@ fi
. ${pbc}/admin/conf/admin.conf
if [ ! -e ${pbc}/conf/server.conf ] ; then
+ echo "You must first create ${pbc}/admin/conf/admin.conf."
+ exit 1
+fi
+. ${pbc}/admin/conf/admin.conf
+if [ ! -e ${pbc}/conf/server.conf ] ; then
echo "You must first create ${pbc}/conf/server.conf."
exit 1
fi
@@ -71,32 +76,24 @@ archfs=${ZFS_VOLUME}/portbuild/${arch}
if ! test_fs "${archfs}"; then
echo "The ${archfs} filesystem does not exist. I'll create and mount it for you."
zfs create ${archfs} || exit 1
-# chown -R ${uid}:${gid} ${archdir} || exit 1
-# chmod -R g+w ${archdir} || 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
echo "The ${lockfiles} directory does not exist. I'll create it for you."
mkdir -p ${lockfiles} || exit 1
- chown -R ${uid}:${gid} ${lockfiles} || exit 1
- chmod -R g+w ${lockfiles} || exit 1
fi
mlist=${archdir}/mlist
if [ ! -e ${mlist} ]; then
echo "${mlist} does not exist. I'll create an empty one."
touch ${mlist}
- chown -R ${uid}:${gid} ${mlist} || exit 1
- chmod 664 ${mlist} || exit 1
fi
conf=${archdir}/portbuild.conf
More information about the svn-src-projects
mailing list