summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2003-02-22 22:22:12 +0000
committerKris Kennaway <kris@FreeBSD.org>2003-02-22 22:22:12 +0000
commitc5c00325364b49ffc9ea235abc9a0a3f9b351cc3 (patch)
tree9c18e9199b9d0c87ae335bb5ffbdcd3ed19d35ea /Tools
parentSimplify the collection of load statistics for the cluster. Loads (diff)
If ${buildworld}=1 in mkbindist.conf, then use the makeworld script to
build world and populate the chroot. Otherwise, if ${ftp}=1 then fetch it from the ftp site as before.
Notes
Notes: svn path=/head/; revision=76204
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/mkbindist92
1 files changed, 44 insertions, 48 deletions
diff --git a/Tools/portbuild/scripts/mkbindist b/Tools/portbuild/scripts/mkbindist
index e2f1ca1b229c..2b4d4e4a9f55 100755
--- a/Tools/portbuild/scripts/mkbindist
+++ b/Tools/portbuild/scripts/mkbindist
@@ -20,61 +20,57 @@ pb=/var/portbuild
here=${pb}/${arch}/${branch}
. ${here}/mkbindist.conf
-if [ ${ftp} = "0" ]; then
+if [ ${buildworld} = "1" ]; then
if ! ${pb}/scripts/makeworld ${arch} ${branch}; then
exit 1
fi
- tmpdir=/var/chroot/
+elif [ ${ftp} = "1" ]; then
+ cd ${here}
+ rm -rf bindist/ftp
+ mkdir -p bindist/ftp
+ cd bindist/ftp
+ for i in ${ftpdists}; do
+ /usr/bin/ftp -a "ftp://${ftpserver}${ftpurl}/${rel}/$i.??"
+ done
+ cd ${here}
+fi
+
+tmpdir=${here}/tmp
+
+# just in case
+umount -f ${tmpdir}/usr/src 2>/dev/null
+
+# Clean up ${tmpdir}
+rm -rf ${tmpdir} 2>/dev/null
+if [ -d ${tmpdir} ]; then
+ chflags -R noschg ${tmpdir}
+ rm -rf ${tmpdir}
+fi
+mkdir -p ${tmpdir}
+
+# Set up the tmpdir directory hierarchy
+cd ${tmpdir}
+mtree -deU -f ${here}/src/etc/mtree/BSD.root.dist -p ${tmpdir}/
+mtree -deU -f ${here}/src/etc/mtree/BSD.var.dist -p ${tmpdir}/var
+mtree -deU -f ${here}/src/etc/mtree/BSD.usr.dist -p ${tmpdir}/usr
+mtree -deU -f ${here}/src/etc/mtree/BSD.local.dist -p ${tmpdir}/usr/local
+
+# Copy the files into the tmpdir. Use an existing built world, or the ftp
+# files.
+if [ "${ftp}" = 0 ]; then
+ (cd ${worlddir}; find -dx . | \
+ grep -v -E '^./usr/(X11R6|local|obj|opt|ports|src)' | \
+ grep -v '^./home' | \
+ grep -v '^./var/db/pkg' | \
+ cpio -dump ${tmpdir})
else
- tmpdir=${here}/tmp
-
- # just in case
- umount -f ${tmpdir}/usr/src 2>/dev/null
-
- # Clean up ${tmpdir}
- rm -rf ${tmpdir} 2>/dev/null
- if [ -d ${tmpdir} ]; then
- chflags -R noschg ${tmpdir}
- rm -rf ${tmpdir}
- fi
- mkdir -p ${tmpdir}
-
- # FTP the snapshot tarball chunks if required
- if [ "${ftp}" != 0 ]; then
- cd ${here}
- rm -rf bindist/ftp
- mkdir -p bindist/ftp
- cd bindist/ftp
- for i in ${ftpdists}; do
- /usr/bin/ftp -a "ftp://${ftpserver}/${ftpurl}/${rel}/$i.??"
- done
- cd ${here}
- fi
-
- # Set up the tmpdir directory hierarchy
- cd ${tmpdir}
- mtree -deU -f ${here}/src/etc/mtree/BSD.root.dist -p ${tmpdir}/
- mtree -deU -f ${here}/src/etc/mtree/BSD.var.dist -p ${tmpdir}/var
- mtree -deU -f ${here}/src/etc/mtree/BSD.usr.dist -p ${tmpdir}/usr
- mtree -deU -f ${here}/src/etc/mtree/BSD.local.dist -p ${tmpdir}/usr/local
-
- # Copy the files into the tmpdir. Use an existing built world, or the ftp
- # files.
- if [ "${useworld}" = 1 ]; then
- (cd ${worlddir}; find -dx . | \
- grep -v -E '^./usr/(X11R6|local|obj|opt|ports|src)' | \
- grep -v '^./home' | \
- grep -v '^./var/db/pkg' | \
- cpio -dump ${tmpdir})
- else
- for i in ${ftpdists}; do
- cat ${here}/bindist/ftp/$(basename $i).?? | tar --unlink -xzpf -
- done
- fi
+ for i in ${ftpdists}; do
+ cat ${here}/bindist/ftp/$(basename $i).?? | tar --unlink -xzpf -
+ done
fi
cd ${tmpdir}
-
+
# Customize the tmpdir
rm -rf $(cat ${here}/bindist/delete)
mkdir -p $(cat ${here}/bindist/dirlist)