aboutsummaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorasami <asami@FreeBSD.org>2000-08-29 16:33:05 +0800
committerasami <asami@FreeBSD.org>2000-08-29 16:33:05 +0800
commit742e6145ecc4734f46a9cd58494edb79fe1eaa3f (patch)
tree17727ac56a50ae01bea9ceff4e001b55b36a16b6 /Tools
parent7a9fb2093f30f1c547156cc483531647a48206ff (diff)
downloadfreebsd-ports-gnome-742e6145ecc4734f46a9cd58494edb79fe1eaa3f.tar.gz
freebsd-ports-gnome-742e6145ecc4734f46a9cd58494edb79fe1eaa3f.tar.zst
freebsd-ports-gnome-742e6145ecc4734f46a9cd58494edb79fe1eaa3f.zip
Split build into two phases, checksum and package, and copy the
distfile to the server right after checksum. This will make it possible to "harvest" distfiles even for ports that don't currently build. (This was a reason for a lot of distfiles being lost in the past -- someone commits a broken port, distfile doesn't get fetched to ftp.FreeBSD.org since package doesn't build, and distfile is gone from the master site before the port is fixed.) This also enables more efficient sharing of distfiles since we can set MASTER_SITE_OVERRIDE to the port build server and have a better chance of finding the distfiles there. Instead of using a simple make package | tee, redirect the output of make package into a separate log file and concatenate it later. For some reason, the gconf build always hangs after the build succeeds (tee doesn't exit). Handle the new arguments (-norestr for NO_RESTRICTED, -noplistcheck for NOPLISTCHECK and -nodummy for NODUMMY) by converting them to environment variables. Add the branch=5 case. Run ldconfig on /usr/lib/compat too.
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/portbuild83
1 files changed, 65 insertions, 18 deletions
diff --git a/Tools/portbuild/scripts/portbuild b/Tools/portbuild/scripts/portbuild
index 27ed80f62f12..944dd6d322ef 100755
--- a/Tools/portbuild/scripts/portbuild
+++ b/Tools/portbuild/scripts/portbuild
@@ -1,11 +1,12 @@
#!/bin/sh
-# usage: $0 BRANCH [-noclean] PKGNAME.tgz DIRNAME [DEPENDENCY.tgz ...]
+# usage: $0 BRANCH [-noclean] [-norestr] [-noplistcheck] [-nodummy] PKGNAME.tgz DIRNAME [DEPENDENCY.tgz ...]
master=bento
export BATCH=t
-export NO_RESTRICTED=t
+export BATCH=t
+#export NO_RESTRICTED=t
#export FOR_CDROM=t
export USA_RESIDENT=YES
#export FORCE_PKG_REGISTER=t
@@ -15,10 +16,13 @@ export PACKAGE_BUILDING=t
export WRKDIRPREFIX=/tmp
#export PKG_NOCOMPRESS=t
# to catch missing dependencies
-export DEPENDS_TARGET=/usr/bin/true
+#export DEPENDS_TARGET=/usr/bin/true
# don't pass -j, -k etc. to sub-makes
unset MAKEFLAGS
unset PORTSDIR
+# to prevent runaway processes -- 256 meg file size limit, one hour CPU limit
+ulimit -f 524288
+ulimit -t 3600
# directories to clean
cleandirs="/usr/local /usr/X11R6 /compat"
@@ -31,6 +35,7 @@ export HTTP_TIMEOUT=900
unset DISPLAY
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:.
+#export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/pkg/bin:.
buildroot=/a/asami/portbuild
@@ -42,17 +47,42 @@ if [ "x$1" = "x-noclean" ]; then
noclean=1
shift
fi
+norestr=0
+if [ "x$1" = "x-norestr" ]; then
+ norestr=1
+ export NO_RESTRICTED=t
+ shift
+fi
+noplistcheck=0
+if [ "x$1" = "x-noplistcheck" ]; then
+ noplistcheck=1
+ export NOPLISTCHECK=t
+ shift
+fi
+nodummy=0
+if [ "x$1" = "x-nodummy" ]; then
+ nodummy=1
+ export NODUMMY=t
+ export MOTIF_OPEN=t
+ export XFREE86_VERSION=4
+ shift
+fi
case ${branch} in
+ 5*)
+ export OSREL=5.0
+ export OSVERSION=500011
+ # export PORTOBJFORMAT=elf
+ ;;
4*)
- export OSREL=4.0
- export OSVERSION=400009
- export PORTOBJFORMAT=elf
+ # export OSREL=4.0
+ # export OSVERSION=400018
+ # export PORTOBJFORMAT=elf
;;
3*)
-# export OSREL=3.3
-# export OSVERSION=330000
-# export PORTOBJFORMAT=elf
+ export OSREL=3.5
+ export OSVERSION=350001
+ # export PORTOBJFORMAT=elf
;;
*)
export OSREL=2.2.8
@@ -139,6 +169,7 @@ done
rm -rf ${chroot}/var/db/pkg/*
+chroot ${chroot} /sbin/ldconfig -m /usr/lib/compat
chroot ${chroot} /sbin/ldconfig -R
chroot ${chroot} /sbin/ldconfig -aout -m /usr/lib/aout
chroot ${chroot} /sbin/ldconfig -aout -m /usr/lib/compat/aout
@@ -160,20 +191,36 @@ scp -p ${master}:${buildroot}/scripts/buildscript ${chroot}
#mount_procfs procfs ${chroot}/proc
-chroot ${chroot} /buildscript ${dirname} 2>&1 | tee -a ${chroot}/tmp/${pkgname}.log
+# phase 1, make checksum
+chroot ${chroot} /buildscript ${dirname} 1 2>&1 | tee -a ${chroot}/tmp/${pkgname}.log
error=$(cat ${chroot}/tmp/status)
-scp ${chroot}/tmp/${pkgname}.log ${master}:${buildroot}/${branch}/logs/${pkgname}.log
-
if [ "${error}" = 0 ]; then
- tar -C ${chroot}/tmp -cf - distfiles | \
- ssh -a $master tar --unlink -C ${buildroot} -xvf -
- tar -C ${chroot}/tmp -cf - packages | \
- ssh -a $master tar --unlink -C ${buildroot}/${branch} -xvf -
- ssh -a $master touch ${buildroot}/${branch}/packages/All/${pkgname}.tgz
- ssh $master rm -f ${buildroot}/${branch}/errors/${pkgname}.log
+# make checksum succeeded
+ ssh -a $master mkdir -p ${buildroot}/distfiles/.pbtmp/${pkgname}
+ tar -C ${chroot}/tmp/distfiles -cf - . | \
+ ssh -a $master tar --unlink -C ${buildroot}/distfiles/.pbtmp/${pkgname} -xvf -
+ ssh -a $master touch ${buildroot}/distfiles/.pbtmp/${pkgname}/.done
+
+# phase 2, make package
+ chroot ${chroot} /buildscript ${dirname} 2 > ${chroot}/tmp/${pkgname}.log2 2>&1
+ cat ${chroot}/tmp/${pkgname}.log2 >> ${chroot}/tmp/${pkgname}.log
+ rm ${chroot}/tmp/${pkgname}.log2
+ scp ${chroot}/tmp/${pkgname}.log ${master}:${buildroot}/${branch}/logs/${pkgname}.log
+ error=$(cat ${chroot}/tmp/status)
+
+ if [ "${error}" = 0 ]; then
+ tar -C ${chroot}/tmp -cf - packages | \
+ ssh -a $master tar --unlink -C ${buildroot}/${branch} -xvf -
+ ssh -a $master [ -f ${buildroot}/${branch}/packages/All/${pkgname}.tgz ] '&&' touch ${buildroot}/${branch}/packages/All/${pkgname}.tgz
+ ssh $master rm -f ${buildroot}/${branch}/errors/${pkgname}.log
+ else
+ scp ${chroot}/tmp/${pkgname}.log ${master}:${buildroot}/${branch}/errors/${pkgname}.log
+ fi
+
else
scp ${chroot}/tmp/${pkgname}.log ${master}:${buildroot}/${branch}/errors/${pkgname}.log
+ scp ${chroot}/tmp/${pkgname}.log ${master}:${buildroot}/${branch}/logs/${pkgname}.log
fi
#umount ${chroot}/proc