* Unmount linprocfs around pkg_adding dependencies, to try and work

around silly failures in some ports when it is present

* Add a footer to completed builds that is recognised by pdispatch to
  retry truncated builds

* If ALWAYS_KEEP_DISTFILES is not present in the environment or port
  makefile, then clean up DISTDIR after the build finishes, to prevent
  collection of distfiles for this port.

* Finish flipping the switch on -noplistcheck - this is activated by
  passing in the NOPLISTCHECK environment variable instead of
  using PLISTCHECK in the opposite case
This commit is contained in:
Kris Kennaway 2005-10-11 03:40:57 +00:00
parent 917dfa95ab
commit e93c55ca9b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=144888

View file

@ -3,9 +3,34 @@
# usage: $0 DIRNAME PHASE
# PHASE is 1 (checksum) or 2 (package)
mountprocfs() {
arch=$1
if [ ${arch} = "i386" ]; then
# JDK ports need linprocfs :(
mkdir -p /compat/linux/proc
mount_linprocfs linprocfs /compat/linux/proc
fi
}
umountprocfs() {
arch=$1
if [ ${arch} = "i386" ]; then
umount -f /compat/linux/proc 2> /dev/null > /dev/null
fi
}
cleanup() {
status=$1
cd ${dir}
keep_distfiles=$(make -V ALWAYS_KEEP_DISTFILES)
distdir=$(make -V DISTDIR)
if [ -z "${keep_distfiles}" -a ! -z "${distdir}" ]; then
rm -rf ${distdir}/*
fi
if [ -e ${dir}/.keep ]; then
cd ${dir}
objdir=$(make -V WRKDIR)
@ -15,7 +40,7 @@ cleanup() {
cat /tmp/make.log${status}
echo 1 > /tmp/status
echo "================================================================"
echo -n "build ended at "
echo -n "build of ${dir} ended at "
date
exit 0
@ -28,6 +53,8 @@ add_pkg() {
cd /tmp/depends
export PKG_PATH=/tmp/depends
if [ ! -z "${pkgs}" ]; then
arch=$(uname -m)
umountprocfs ${arch}
echo "adding dependencies"
for i in $pkgs; do
echo "pkg_add $i"
@ -43,6 +70,7 @@ add_pkg() {
fi
fi
done
mountprocfs ${arch}
fi
}
@ -176,7 +204,7 @@ EOF
grep ' extra$' /tmp/list3 | awk '{print $1}' | xargs -J % find % -ls > /tmp/list4
grep ' missing$' /tmp/list3 > /tmp/list5
grep -vE ' (extra|missing)$' /tmp/list3 > /tmp/list6
if [ "x${PLISTCHECK}" != "x" ]; then
if [ "x${NOPLISTCHECK}" = "x" ]; then
if grep -qE 'usr/(local|X11R6)/(bin/|include/|man/|sbin/|share/|share/|lib/|libdata/|libexec/)' /tmp/list4; then
echo "1" > /tmp/status
fi
@ -211,7 +239,7 @@ EOF
if [ -s /tmp/list6 ]; then
echo "list of filesystem changes from before and after port installation and deinstallation"
cat /tmp/list6
if [ "x${PLISTCHECK}" != "x" ]; then
if [ "x${NOPLISTCHECK}" = "x" ]; then
echo "1" > /tmp/status
fi
fi
@ -223,12 +251,22 @@ EOF
kill $(jobid %1)
fi
cd ${dir}
keep_distfiles=$(make -V ALWAYS_KEEP_DISTFILES)
distdir=$(make -V DISTDIR)
if [ -z "${keep_distfiles}" -a ! -z "${distdir}" ]; then
rm -rf ${distdir}/*
fi
if [ -e ${dir}/.keep ]; then
cd ${dir}
objdir=$(make -V WRKDIR)
tar cfjC /tmp/work.tbz ${objdir}/.. work
fi
echo "================================================================"
echo -n "build of ${dir} ended at "
date
fi
exit 0