diff options
author | kris <kris@FreeBSD.org> | 2003-02-22 22:22:12 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2003-02-22 22:22:12 +0000 |
commit | 8fe1503464ace8516a4f18a07adad9e3e7a5c197 (patch) | |
tree | ddb6e1d7c4105aab73e1b004714f3d6eaab37833 /Tools/portbuild | |
parent | d4d78754558e20ff95e019938d742d62a96a95a7 (diff) | |
download | FreeBSD-ports-8fe1503464ace8516a4f18a07adad9e3e7a5c197.zip FreeBSD-ports-8fe1503464ace8516a4f18a07adad9e3e7a5c197.tar.gz |
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.
Diffstat (limited to 'Tools/portbuild')
-rwxr-xr-x | Tools/portbuild/scripts/mkbindist | 92 |
1 files changed, 44 insertions, 48 deletions
diff --git a/Tools/portbuild/scripts/mkbindist b/Tools/portbuild/scripts/mkbindist index e2f1ca1..2b4d4e4 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) |