head	1.77;
access;
symbols
	pkgsrc-2014Q1:1.76.0.32
	pkgsrc-2014Q1-base:1.76
	pkgsrc-2013Q4:1.76.0.30
	pkgsrc-2013Q4-base:1.76
	pkgsrc-2013Q3:1.76.0.28
	pkgsrc-2013Q3-base:1.76
	pkgsrc-2013Q2:1.76.0.26
	pkgsrc-2013Q2-base:1.76
	pkgsrc-2013Q1:1.76.0.24
	pkgsrc-2013Q1-base:1.76
	pkgsrc-2012Q4:1.76.0.22
	pkgsrc-2012Q4-base:1.76
	pkgsrc-2012Q3:1.76.0.20
	pkgsrc-2012Q3-base:1.76
	pkgsrc-2012Q2:1.76.0.18
	pkgsrc-2012Q2-base:1.76
	pkgsrc-2012Q1:1.76.0.16
	pkgsrc-2012Q1-base:1.76
	pkgsrc-2011Q4:1.76.0.14
	pkgsrc-2011Q4-base:1.76
	pkgsrc-2011Q3:1.76.0.12
	pkgsrc-2011Q3-base:1.76
	pkgsrc-2011Q2:1.76.0.10
	pkgsrc-2011Q2-base:1.76
	pkgsrc-2011Q1:1.76.0.8
	pkgsrc-2011Q1-base:1.76
	pkgsrc-2010Q4:1.76.0.6
	pkgsrc-2010Q4-base:1.76
	pkgsrc-2010Q3:1.76.0.4
	pkgsrc-2010Q3-base:1.76
	pkgsrc-2010Q2:1.76.0.2
	pkgsrc-2010Q2-base:1.76
	pkgsrc-2010Q1:1.75.0.8
	pkgsrc-2010Q1-base:1.75
	pkgsrc-2009Q4:1.75.0.6
	pkgsrc-2009Q4-base:1.75
	pkgsrc-2009Q3:1.75.0.4
	pkgsrc-2009Q3-base:1.75
	pkgsrc-2009Q2:1.75.0.2
	pkgsrc-2009Q2-base:1.75
	pkgsrc-2009Q1:1.74.0.12
	pkgsrc-2009Q1-base:1.74
	pkgsrc-2008Q4:1.74.0.10
	pkgsrc-2008Q4-base:1.74
	pkgsrc-2008Q3:1.74.0.8
	pkgsrc-2008Q3-base:1.74
	cube-native-xorg:1.74.0.6
	cube-native-xorg-base:1.74
	pkgsrc-2008Q2:1.74.0.4
	pkgsrc-2008Q2-base:1.74
	cwrapper:1.74.0.2
	pkgsrc-2008Q1:1.72.0.2
	pkgsrc-2008Q1-base:1.72
	pkgsrc-2007Q4:1.70.0.4
	pkgsrc-2007Q4-base:1.70
	pkgsrc-2007Q3:1.70.0.2
	pkgsrc-2007Q3-base:1.70
	pkgsrc-2007Q2:1.67.0.2
	pkgsrc-2007Q2-base:1.67
	pkgsrc-2007Q1:1.66.0.4
	pkgsrc-2007Q1-base:1.66
	jlam-pkgviews:1.66.0.2
	jlam-pkgviews-base:1.66
	pkgsrc-2006Q4:1.64.0.2
	pkgsrc-2006Q4-base:1.64
	pkgsrc-2006Q3:1.60.0.6
	pkgsrc-2006Q3-base:1.60
	pkgsrc-2006Q2:1.60.0.4
	pkgsrc-2006Q2-base:1.60
	tv-derecurse-eol:1.40.2.3
	pkgsrc-2006Q1:1.60.0.2
	pkgsrc-2006Q1-base:1.60
	pkgsrc-2005Q4:1.56.0.2
	pkgsrc-2005Q4-base:1.56
	pkgsrc-2005Q3:1.50.0.2
	pkgsrc-2005Q3-base:1.50
	pkgsrc-2005Q2:1.48.0.2
	pkgsrc-2005Q2-base:1.48
	tv-derecurse-merge:1.47
	pkgsrc-2005Q1:1.44.0.2
	pkgsrc-2005Q1-base:1.44
	pkgsrc-2004Q4:1.40.0.4
	pkgsrc-2004Q4-base:1.40
	tv-derecurse:1.40.0.2
	tv-derecurse-base:1.44
	pkgsrc-2004Q3:1.39.0.4
	pkgsrc-2004Q3-base:1.39
	pkgsrc-2004Q2:1.39.0.2
	pkgsrc-2004Q2-base:1.39
	pkgsrc-2004Q1:1.36.0.2
	pkgsrc-2004Q1-base:1.36
	pkgsrc-2003Q4:1.31.0.2
	pkgsrc-2003Q4-base:1.31
	pkgviews-mk:1.27.0.2
	pkgviews-mk-base:1.28
	netbsd-1-6-1:1.25.0.2
	netbsd-1-6-1-base:1.25
	netbsd-1-6:1.22.0.4
	netbsd-1-6-RELEASE-base:1.22
	pkgviews:1.21.0.2
	pkgviews-base:1.27
	buildlink2:1.18.0.2
	buildlink2-base:1.23
	netbsd-1-5-PATCH003:1.18
	netbsd-1-5-PATCH001:1.16
	netbsd-1-5-RELEASE:1.4
	netbsd-1-4-PATCH003:1.4;
locks; strict;
comment	@# @;


1.77
date	2014.06.02.10.24.05;	author wiz;	state dead;
branches;
next	1.76;
commitid	I50hUg08qEFcZVCx;

1.76
date	2010.05.11.18.36.15;	author mbalmer;	state Exp;
branches;
next	1.75;

1.75
date	2009.07.02.22.34.16;	author sketch;	state Exp;
branches;
next	1.74;

1.74
date	2008.06.10.08.17.47;	author sketch;	state Exp;
branches;
next	1.73;

1.73
date	2008.06.09.12.51.41;	author sketch;	state Exp;
branches;
next	1.72;

1.72
date	2008.03.15.16.27.43;	author joerg;	state Exp;
branches;
next	1.71;

1.71
date	2008.01.04.15.49.08;	author rillig;	state Exp;
branches;
next	1.70;

1.70
date	2007.07.21.12.48.31;	author adrianp;	state Exp;
branches;
next	1.69;

1.69
date	2007.07.14.17.17.45;	author adrianp;	state Exp;
branches;
next	1.68;

1.68
date	2007.07.02.14.54.09;	author joerg;	state Exp;
branches;
next	1.67;

1.67
date	2007.05.20.23.33.06;	author kristerw;	state Exp;
branches;
next	1.66;

1.66
date	2007.01.28.19.23.22;	author kristerw;	state Exp;
branches;
next	1.65;

1.65
date	2007.01.24.02.48.51;	author rillig;	state Exp;
branches;
next	1.64;

1.64
date	2006.12.15.13.15.06;	author martti;	state Exp;
branches;
next	1.63;

1.63
date	2006.11.06.21.45.18;	author tv;	state Exp;
branches;
next	1.62;

1.62
date	2006.11.06.21.08.43;	author tv;	state Exp;
branches;
next	1.61;

1.61
date	2006.10.02.16.37.22;	author dmcmahill;	state Exp;
branches;
next	1.60;

1.60
date	2006.02.12.05.00.33;	author rillig;	state Exp;
branches
	1.60.6.1;
next	1.59;

1.59
date	2006.02.11.23.54.25;	author rillig;	state Exp;
branches;
next	1.58;

1.58
date	2006.02.07.21.34.48;	author rillig;	state Exp;
branches;
next	1.57;

1.57
date	2006.01.29.23.07.04;	author rillig;	state Exp;
branches;
next	1.56;

1.56
date	2005.12.08.21.21.15;	author rillig;	state Exp;
branches;
next	1.55;

1.55
date	2005.12.06.09.15.29;	author rillig;	state Exp;
branches;
next	1.54;

1.54
date	2005.12.03.01.00.37;	author rillig;	state Exp;
branches;
next	1.53;

1.53
date	2005.11.30.17.31.06;	author joerg;	state Exp;
branches;
next	1.52;

1.52
date	2005.11.20.15.25.39;	author rillig;	state Exp;
branches;
next	1.51;

1.51
date	2005.11.20.14.55.13;	author rillig;	state Exp;
branches;
next	1.50;

1.50
date	2005.08.26.07.24.53;	author reed;	state Exp;
branches;
next	1.49;

1.49
date	2005.08.26.07.19.05;	author reed;	state Exp;
branches;
next	1.48;

1.48
date	2005.06.10.13.09.07;	author sketch;	state Exp;
branches;
next	1.47;

1.47
date	2005.03.31.23.36.15;	author reed;	state Exp;
branches;
next	1.46;

1.46
date	2005.03.30.20.21.07;	author kristerw;	state Exp;
branches;
next	1.45;

1.45
date	2005.03.29.00.55.50;	author hubertf;	state Exp;
branches;
next	1.44;

1.44
date	2005.01.19.20.58.01;	author tv;	state Exp;
branches;
next	1.43;

1.43
date	2005.01.18.15.04.34;	author tv;	state Exp;
branches;
next	1.42;

1.42
date	2005.01.18.14.11.11;	author tv;	state Exp;
branches;
next	1.41;

1.41
date	2005.01.11.18.33.16;	author tv;	state Exp;
branches;
next	1.40;

1.40
date	2004.11.16.18.34.12;	author jlam;	state Exp;
branches
	1.40.2.1;
next	1.39;

1.39
date	2004.04.19.23.09.55;	author seb;	state Exp;
branches;
next	1.38;

1.38
date	2004.04.09.18.43.14;	author jschauma;	state Exp;
branches;
next	1.37;

1.37
date	2004.04.09.18.29.37;	author jschauma;	state Exp;
branches;
next	1.36;

1.36
date	2004.02.14.04.06.29;	author grant;	state Exp;
branches;
next	1.35;

1.35
date	2004.01.20.12.44.30;	author grant;	state Exp;
branches;
next	1.34;

1.34
date	2004.01.15.09.57.50;	author grant;	state Exp;
branches;
next	1.33;

1.33
date	2003.12.07.11.43.22;	author agc;	state Exp;
branches;
next	1.32;

1.32
date	2003.11.28.22.46.48;	author hubertf;	state Exp;
branches;
next	1.31;

1.31
date	2003.11.20.00.02.59;	author hubertf;	state Exp;
branches;
next	1.30;

1.30
date	2003.09.16.17.21.36;	author grant;	state Exp;
branches;
next	1.29;

1.29
date	2003.09.02.07.00.06;	author jlam;	state Exp;
branches;
next	1.28;

1.28
date	2003.08.26.08.18.09;	author hubertf;	state Exp;
branches;
next	1.27;

1.27
date	2003.06.06.18.28.47;	author jschauma;	state Exp;
branches
	1.27.2.1;
next	1.26;

1.26
date	2003.05.06.17.42.04;	author jmmv;	state Exp;
branches;
next	1.25;

1.25
date	2002.11.03.22.59.21;	author hubertf;	state Exp;
branches;
next	1.24;

1.24
date	2002.08.22.08.21.31;	author jlam;	state Exp;
branches;
next	1.23;

1.23
date	2002.08.20.02.17.57;	author hubertf;	state Exp;
branches;
next	1.22;

1.22
date	2002.08.07.10.56.12;	author agc;	state Exp;
branches
	1.22.4.1;
next	1.21;

1.21
date	2002.06.29.03.33.35;	author dmcmahill;	state Exp;
branches;
next	1.20;

1.20
date	2002.06.28.08.46.38;	author agc;	state Exp;
branches;
next	1.19;

1.19
date	2002.06.28.07.54.36;	author agc;	state Exp;
branches;
next	1.18;

1.18
date	2002.03.14.00.13.29;	author hubertf;	state Exp;
branches
	1.18.2.1;
next	1.17;

1.17
date	2001.07.21.19.58.32;	author dmcmahill;	state Exp;
branches;
next	1.16;

1.16
date	2001.05.09.03.05.24;	author hubertf;	state Exp;
branches;
next	1.15;

1.15
date	2001.05.05.14.01.09;	author dmcmahill;	state Exp;
branches;
next	1.14;

1.14
date	2001.04.14.17.20.07;	author dmcmahill;	state Exp;
branches;
next	1.13;

1.13
date	2001.04.02.14.25.24;	author hubertf;	state Exp;
branches;
next	1.12;

1.12
date	2001.03.19.11.25.39;	author dmcmahill;	state Exp;
branches;
next	1.11;

1.11
date	2001.03.14.15.04.03;	author hubertf;	state Exp;
branches;
next	1.10;

1.10
date	2001.02.01.08.25.39;	author dmcmahill;	state Exp;
branches;
next	1.9;

1.9
date	2000.12.31.17.38.32;	author dmcmahill;	state Exp;
branches;
next	1.8;

1.8
date	2000.12.30.14.53.28;	author dmcmahill;	state Exp;
branches;
next	1.7;

1.7
date	2000.12.22.01.35.33;	author dmcmahill;	state Exp;
branches;
next	1.6;

1.6
date	2000.12.15.23.08.42;	author hubertf;	state Exp;
branches;
next	1.5;

1.5
date	2000.12.05.16.33.27;	author hubertf;	state Exp;
branches;
next	1.4;

1.4
date	2000.09.29.04.27.42;	author hubertf;	state Exp;
branches;
next	1.3;

1.3
date	2000.09.24.16.22.08;	author hubertf;	state Exp;
branches;
next	1.2;

1.2
date	2000.09.15.22.27.16;	author hubertf;	state Exp;
branches;
next	1.1;

1.1
date	2000.09.15.22.05.47;	author hubertf;	state Exp;
branches;
next	;

1.60.6.1
date	2006.10.07.02.30.53;	author salo;	state Exp;
branches;
next	;

1.40.2.1
date	2005.01.13.20.11.55;	author tv;	state Exp;
branches;
next	1.40.2.2;

1.40.2.2
date	2005.01.24.18.40.01;	author tv;	state Exp;
branches;
next	1.40.2.3;

1.40.2.3
date	2005.05.17.18.29.45;	author tv;	state Exp;
branches;
next	1.40.2.4;

1.40.2.4
date	2006.06.07.15.25.39;	author tv;	state dead;
branches;
next	;

1.27.2.1
date	2003.08.21.02.06.17;	author jlam;	state Exp;
branches;
next	1.27.2.2;

1.27.2.2
date	2003.08.22.07.15.48;	author jlam;	state Exp;
branches;
next	1.27.2.3;

1.27.2.3
date	2003.08.26.21.58.07;	author jlam;	state Exp;
branches;
next	1.27.2.4;

1.27.2.4
date	2003.08.31.06.37.16;	author jlam;	state Exp;
branches;
next	1.27.2.5;

1.27.2.5
date	2003.08.31.06.39.36;	author jlam;	state Exp;
branches;
next	1.27.2.6;

1.27.2.6
date	2003.08.31.08.12.38;	author jlam;	state Exp;
branches;
next	;

1.22.4.1
date	2002.08.20.12.44.53;	author wiz;	state Exp;
branches;
next	;

1.18.2.1
date	2002.08.21.05.19.50;	author jlam;	state Exp;
branches;
next	1.18.2.2;

1.18.2.2
date	2002.08.21.22.01.37;	author jlam;	state Exp;
branches;
next	;


desc
@@


1.77
log
@Remove old bulk build code. Use pbulk.
@
text
@#!/bin/sh
# $NetBSD: pre-build,v 1.76 2010/05/11 18:36:15 mbalmer Exp $
#
# Clean up system to be ready for bulk pkg build
#
# (c) 2000 Hubert Feyrer, All Rights Reserved.
#

#set -v		# Debug

# Pull in USR_PKGSRC:
if [ -f "$BULK_BUILD_CONF" ]; then
    . "$BULK_BUILD_CONF"
else
    . `dirname $0`/build.conf
fi

PRUNEDISTFILES=${PRUNEDISTFILES:-"no"}
PRUNEPACKAGES=${PRUNEPACKAGES:-"yes"}
PRUNELINKS=${PRUNEPACKAGES:-"yes"}
PKG_ADMIN="pkg_admin"
PKG_INFO="pkg_info"

some_package_dir=${USR_PKGSRC}/pkgtools/lintpkgsrc

# Extract the name of the files used for the build log and broken build log.
# These have defaults set by bsd.bulk-pkg.mk and may be overridden in
# /etc/mk.conf
BULKFILESDIR=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=BULKFILESDIR )`;
if [ "$BULKFILESDIR" = "" ]; then
	echo "pre-build> Had problems determining the directory of .broken* files"
	exit 1
fi
BROKENF=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=BROKENFILE )`;
if [ "$BROKENF" = "" ]; then
	echo "pre-build> Had problems determining the name of the .broken files"
	exit 1
fi
NOTAVAILF=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=NOT_AVAILABLE_FILE )`;
if [ "$NOTAVAILF" = "" ]; then
	echo "pre-build> Had problems determining the name of the .bulk-not_available files"
	exit 1
fi
BRKWRKLOG=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=BROKENWRKLOG )`;
if [ "$BRKWRKLOG" = "" ]; then
	echo "pre-build> Had problems determining the name of the .broken.work files"
	exit 1
fi
BLDLOG=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=BUILDLOG )`;
if [ "$BLDLOG" = "" ]; then
	echo "pre-build> Had problems determining the name of the .make files"
	exit 1
fi
LINTPKGSRC_DB=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=LINTPKGSRC_DB )`;
if [ "$LINTPKGSRC_DB" = "" ]; then
	echo "pre-build> Had problems determining the name of the .lintpkgsrc.db file"
	exit 1
fi
STARTFILE=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=STARTFILE )`;
if [ "$STARTFILE" = "" ]; then
	echo "pre-build> Had problems determining the name of the .start file"
	exit 1
fi

LOCALBASE=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=LOCALBASE )`;
X11BASE=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=X11BASE )`;
DISTDIR=`( cd ${some_package_dir} ; ${BMAKE} show-var VARNAME=DISTDIR )`;

# Create ${BULKFILESDIR} if necessary
echo "pre-build> Creating ${BULKFILESDIR} if necessary"
mkdir -p "${BULKFILESDIR}"

# Make sure the pkg-vulnerabilities file is up to date
_INFO_VER=`${PKG_INFO} -V`;
echo "pre-build> Making sure vulnerability-list is up to date:"
if [ -z "$UPDATE_VULNERABILITY_LIST" -o "$UPDATE_VULNERABILITY_LIST" = yes ]; then
	_PKGVULNDIR=`audit-packages ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`
	download-vulnerability-list ${DOWNLOAD_VULNERABILITY_LIST_FLAGS}
	if [ "x${_PKGVULNDIR}" != "x${DISTDIR}" ]; then
		cp ${_PKGVULNDIR}/pkg-vulnerabilities ${DISTDIR}
	fi
	echo 'pre-build> done.'
else
	echo 'pre-build> (skipped)'
fi

# On non-NetBSD platforms we need to keep the bootstrap-files!
if [ x"$BMAKE" = x"bmake" ]; then
	( cd "$LOCALBASE" && tar cf /tmp/$$.tar \
		sbin/audit-packages sbin/download-vulnerability-list         \
		sbin/pkg_add sbin/pkg_admin sbin/pkg_create                  \
		sbin/pkg_delete sbin/pkg_info \
		share/mk/sys.mk share/mk/bsd.dep.mk share/mk/bsd.depall.mk   \
		share/mk/bsd.files.mk share/mk/bsd.hostprog.mk               \
		share/mk/bsd.doc.mk share/mk/bsd.inc.mk share/mk/bsd.info.mk \
		share/mk/bsd.kernobj.mk share/mk/bsd.kinc.mk                 \
		share/mk/bsd.kmod.mk share/mk/bsd.lib.mk                     \
		share/mk/bsd.links.mk share/mk/bsd.man.mk                    \
		share/mk/bsd.nls.mk share/mk/bsd.obj.mk                      \
		share/mk/bsd.prog.mk share/mk/bsd.subdir.mk                  \
		share/mk/bsd.sys.mk share/mk/bsd.own.mk share/mk/bsd.README  \
		bin/bmake bin/nawk bin/nbsed bin/pdksh bin/install-sh        \
		man/cat1/nbsed.0 man/cat1/pkg_add.0 man/cat1/pkg_admin.0     \
		man/cat1/pkg_create.0 man/cat1/pkg_delete.0                  \
		man/cat1/pkg_info.0 man/cat5/pkg_install.conf.0              \
		man/cat5/pkg_summary.0 man/cat7/pkgsrc.0 man/man1/bmake.1    \
		man/man1/nawk.1 man/man1/nbsed.1 man/man1/pkg_add.1          \
		man/man1/pkg_admin.1 man/man1/pkg_create.1                   \
		man/man1/pkg_delete.1 man/man1/pkg_info.1 man/man1/pdksh.1   \
		man/man5/pkg_install.conf.5 man/man5/pkg_summary.5           \
		man/man7/pkgsrc.7 etc/mk.conf )
fi

#
# Clean out everything and its mother
#
PKG_DBDIR=`(cd "${some_package_dir}" && ${BMAKE} show-var VARNAME=PKG_DBDIR)`
DEPOTBASE=`(cd "${some_package_dir}" && ${BMAKE} show-var VARNAME=DEPOTBASE)`
PKG_TOOLS_BIN=`(cd "${some_package_dir}" && ${BMAKE} show-var VARNAME=PKG_TOOLS_BIN)`

for dbdir in "${PKG_DBDIR}" "${DEPOTBASE}"; do
	echo "pre-build> Removing all installed packages in ${dbdir}"

	# The Solaris /bin/sh requires the following weird-looking code.
	if (cd "$dbdir" 1>/dev/null 2>&1); then
		cd "$dbdir"

		for pkg in *
		do
			if ${PKG_TOOLS_BIN}/pkg_info -K "$dbdir" -qe "$pkg"; then
				echo "pre-build> ${PKG_TOOLS_BIN}/pkg_delete -r ${pkg}"
				${PKG_TOOLS_BIN}/pkg_delete -K "$dbdir" -r "$pkg"
			fi
		done
		#
		# this should have removed everything.
		# Now force any broken pkgs to deinstall.
		#
		for pkg in *
		do
			if ${PKG_TOOLS_BIN}/pkg_info -K "$dbdir" -qe "$pkg"; then
				echo "pre-build> ${PKG_TOOLS_BIN}/pkg_delete -f ${pkg}"
				${PKG_TOOLS_BIN}/pkg_delete -K "$dbdir" -f "$pkg"
			fi
		done

		# We've tried our best to get rid of the pkgs, now do it
		# the hard way.  If it wasn't for stuff in $X11BASE, I
		# wouldn't have hard feelings about this!
		rm -fr *
	fi
done

cd "$LOCALBASE" && rm -fr * && rm -fr .??*;
if [ x"$BMAKE" = x"bmake" ]; then
	( cd "$LOCALBASE" && tar xf /tmp/$$.tar )
fi

# Stuff known to be broken
rm -fr "$X11BASE/share/gimp"
rm -fr "$X11BASE/share/gnome"
rm -fr "$X11BASE/share/kde"
rm -fr "$X11BASE/share/netscape"
rm -fr /var/tmp/inst*
rm -fr "$X11BASE/lib/libgimp"*	# gimp doesn't build with old libs around
rm -fr /nonexistent		# broken useradd on pop3d
rm -fr /home/majordom		# mail/majordomo pkg
rm -fr /home/nut		# sysutils/ups-net
rm -fr /var/wwwoffle		# www/wwwoffle
rm -fr /tmp/config-guess-*
rm -fr /tmp/mod*


# Clean up state files
cd "${USR_PKGSRC}"
echo "pre-build> Cleaning up leftover state files from previous runs"
rm -f "${BULKFILESDIR}"/*/*/$BROKENF "${BULKFILESDIR}"/*/*/$BRKWRKLOG "${BULKFILESDIR}"/*/*/$BLDLOG
rm -f "${BULKFILESDIR}"/*/*/$NOTAVAILF
rm -f "${BULKFILESDIR}/$BROKENF" "${BULKFILESDIR}/$BRKWRKLOG" "${BULKFILESDIR}/$BLDLOG" "$STARTFILE"


#
# Remove old/broken distfiles and binary packages
#
PACKAGES=`( cd "${some_package_dir}" && ${BMAKE} show-var VARNAME=PACKAGES )`

case "$LINTPKGSRC_CACHE$PRUNEDISTFILES$PRUNEPACKAGES" in
*yes*|*YES*)
	# install lintpkgsrc to support any of these options
	( cd "${USR_PKGSRC}/pkgtools/lintpkgsrc" && ${BMAKE} PRECLEAN=yes bulk-install )
	;;
esac

case "$LINTPKGSRC_CACHE" in
yes|YES)
	echo "pre-build> Creating lintpkgsrc cache database."
	lintpkgsrc -K "$PACKAGES" -P "$USR_PKGSRC" -M "$DISTDIR" -E "$LINTPKGSRC_DB"
	lintpkgsrc_cache="-I $LINTPKGSRC_DB"
	echo "pre-build> done."
	;;
*)
	lintpkgsrc_cache=''
	;;
esac

case "$PRUNEDISTFILES" in
yes|YES)
	echo "pre-build> Removing old/broken distfiles"
	lintpkgsrc $lintpkgsrc_cache -K "$PACKAGES" -P "$USR_PKGSRC" -M "$DISTDIR" -o -m -r
	echo "pre-build> done."
	;;
*)
	echo "pre-build> Skipping distfile pruning."
	;;
esac

case "$PRUNEPACKAGES" in
yes|YES)
	echo "pre-build> Removing old (out of date) binary packages"
	lintpkgsrc $lintpkgsrc_cache -K "$PACKAGES" -P "$USR_PKGSRC" -M "$DISTDIR" -p -r
	echo "pre-build> done."
	;;
*)
	echo "pre-build> Skipping packages pruning."
	;;
esac

case "$PRUNELINKS" in
yes|YES)
	echo "pre-build> Checking for and removing orphaned packages links"
	find "$PACKAGES" -type l -print |  \
	while read f
	do
		if [ ! -d "$f" -a ! -f "$f" ]; then
			echo "pre-build> Removing orphaned link: \"$f\""
			rm "$f"
		fi
	done
	echo "pre-build> done."
	;;
*)
	echo "pre-build> Skipping pruning of packages links."
	;;
esac

# Clean out the packages added above so that the real bulk build
# is started in a consistent state.
for dbdir in "${PKG_DBDIR}" "${DEPOTBASE}"; do
	echo "pre-build> Removing all installed packages in ${dbdir}"
	if [ -d "$dbdir" ]; then
		cd "$dbdir"
		for pkg in *
		do
			if ${PKG_TOOLS_BIN}/pkg_info -K "$dbdir" -qe "$pkg"; then
				echo "pre-build> ${PKG_TOOLS_BIN}/pkg_delete -r ${pkg}"
				${PKG_TOOLS_BIN}/pkg_delete -K "$dbdir" -r "$pkg"
			fi
		done
	fi
done

# on non-NetBSD, we don't want these to build as they overwrite
# bootstrap-pkgsrc generated files and thus would break the following builds.

if [ x"$BMAKE" = x"bmake" ]; then
	for pkg in devel/bmake devel/mk-files lang/nawk \
	    pkgtools/bootstrap-mk-files pkgtools/bootstrap-extras \
	    pkgtools/pkg_install \
	    shells/pdksh sysutils/install-sh textproc/nbsed; do
		mkdir -p "${BULKFILESDIR}/${pkg}"
		echo "Don't blow away bootstrap-pkgsrc stuff!" \
		> "${BULKFILESDIR}/${pkg}/${BROKENF}"
	done
fi

cd "${USR_PKGSRC}"

if [ -f mk/bulk/pre-build.local ]; then
	export BROKENF
	. mk/bulk/pre-build.local
fi

if [ ! -d "${PKG_DBDIR}" ]; then
	mkdir -p "${PKG_DBDIR}"
fi

echo "This file marks the start time of the bulk build." > "$STARTFILE"
@


1.76
log
@Language fix: upto date -> up to date.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.75 2009/07/02 22:34:16 sketch Exp $
@


1.75
log
@Sync bootstrap file list with reality.  On the plus side, mk/bulk works again.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.74 2008/06/10 08:17:47 sketch Exp $
d75 1
a75 1
echo "pre-build> Making sure vulnerability-list is upto date:"
@


1.74
log
@Mark shells/pdksh as broken so it doesn't get removed part-way through the
build and kill bmake.  This isn't really a great solution as it means it
won't get built on any platform, maybe we should just make pdksh a bmake
dependancy on every OS.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.73 2008/06/09 12:51:41 sketch Exp $
d92 1
a92 1
		sbin/pkg_delete sbin/pkg_info sbin/pkg_view sbin/linkfarm    \
d101 7
a107 15
		share/mk/bsd.sys.mk share/mk/bsd.own.mk                      \
		bin/bmake bin/ftp bin/digest bin/nawk bin/nbsed bin/pdksh    \
		bin/install-sh bin/pax bin/tar bin/cpio                      \
		man/cat1/audit-packages.0                                    \
		man/cat1/download-vulnerability-list.0                       \
		man/cat1/ftp.1 man/cat1/pax.0                                \
		man/cat1/tar.0 man/cat1/cpio.0 man/cat1/pkg_add.0            \
		man/cat1/pkg_admin.0 man/cat1/pkg_create.0                   \
		man/cat1/pkg_delete.0 man/cat1/pkg_info.0                    \
		man/cat1/pkg_view.0 man/cat1/linkfarm.0                      \
		man/cat5/audit-packages.conf.0                               \
		man/man1/audit-packages.1                                    \
		man/man1/download-vulnerability-list.1                       \
		man/man1/digest.1 man/man1/pax.1 man/man1/cpio.1             \
		man/man1/tar.1 man/man1/nbsed.1 man/man1/pkg_add.1           \
d109 3
a111 4
		man/man1/pkg_delete.1 man/man1/pkg_info.1                    \
		man/man1/pkg_view.1 man/man1/linkfarm.1 man/man1/pdksh.1     \
		man/man5/audit-packages.conf.5 man/cat7/packages.0           \
		etc/mk.conf share/examples/pkg_install/audit-packages.conf )
d266 3
a268 3
	for pkg in archivers/pax devel/bmake devel/mk-files lang/nawk \
	    net/tnftp pkgtools/bootstrap-mk-files pkgtools/bootstrap-extras \
	    pkgtools/tnftp pkgtools/pax pkgtools/pkg_install \
@


1.73
log
@For some reason, devel/bmake now requires shells/pdksh on Solaris.  Update
the save-files list to accommodate.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.72 2008/03/15 16:27:43 joerg Exp $
d278 1
a278 1
	    sysutils/install-sh textproc/nbsed; do
@


1.72
log
@Remove remaining compat code for old pkg_install versions.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.71 2008/01/04 15:49:08 rillig Exp $
d102 1
a102 1
		bin/bmake bin/ftp bin/digest bin/nawk bin/nbsed              \
d118 1
a118 1
		man/man1/pkg_view.1 man/man1/linkfarm.1                      \
@


1.71
log
@Replaced all references to pkglint with lintpkgsrc, which has its own
package since a few days.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.70 2007/07/21 12:48:31 adrianp Exp $
d77 4
a80 10
	if ${PKG_ADMIN} pmatch 'pkg_install<20070714' pkg_install-${_INFO_VER}; then
       ( cd "${USR_PKGSRC}/security/audit-packages" \
         && ${BMAKE} bulk-install \
         && env PKGVULNDIR="${DISTDIR}" download-vulnerability-list )
	else
		_PKGVULNDIR=`audit-packages ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`
		download-vulnerability-list ${DOWNLOAD_VULNERABILITY_LIST_FLAGS}
		if [ "x${_PKGVULNDIR}" != "x${DISTDIR}" ]; then
			cp ${_PKGVULNDIR}/pkg-vulnerabilities ${DISTDIR}
		fi
d82 1
a82 1
       echo 'pre-build> done.'
d84 1
a84 1
       echo 'pre-build> (skipped)'
@


1.70
log
@Define ${PKG_INFO} before using it - from wiz@@
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.69 2007/07/14 17:17:45 adrianp Exp $
d24 1
a24 1
PKGLINT_PKG_DIR=${USR_PKGSRC}/pkgtools/pkglint
d29 1
a29 1
BULKFILESDIR=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BULKFILESDIR )`;
d34 1
a34 1
BROKENF=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BROKENFILE )`;
d39 1
a39 1
NOTAVAILF=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=NOT_AVAILABLE_FILE )`;
d44 1
a44 1
BRKWRKLOG=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BROKENWRKLOG )`;
d49 1
a49 1
BLDLOG=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BUILDLOG )`;
d54 1
a54 1
LINTPKGSRC_DB=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=LINTPKGSRC_DB )`;
d59 1
a59 1
STARTFILE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=STARTFILE )`;
d65 3
a67 3
LOCALBASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=LOCALBASE )`;
X11BASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=X11BASE )`;
DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=DISTDIR )`;
d132 3
a134 3
PKG_DBDIR=`(cd "${PKGLINT_PKG_DIR}" && ${BMAKE} show-var VARNAME=PKG_DBDIR)`
DEPOTBASE=`(cd "${PKGLINT_PKG_DIR}" && ${BMAKE} show-var VARNAME=DEPOTBASE)`
PKG_TOOLS_BIN=`(cd "${PKGLINT_PKG_DIR}" && ${BMAKE} show-var VARNAME=PKG_TOOLS_BIN)`
d200 1
a200 1
PACKAGES=`( cd "${PKGLINT_PKG_DIR}" && ${BMAKE} show-var VARNAME=PACKAGES )`
d204 2
a205 2
	# install pkglint to support any of these options
	( cd "${PKGLINT_PKG_DIR}" && ${BMAKE} PRECLEAN=yes bulk-install )
@


1.69
log
@Add support for the upcoming pkg_install-20070714 which now includes
audit-packages.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.68 2007/07/02 14:54:09 joerg Exp $
d22 1
@


1.68
log
@Remove USE_MTREE support. Keep one copy (the NetBSD version) for
the purpose of print-PLIST in plist/common-dirs.mtree.

Discussed with wiz@@, no objections on tech-pkg@@.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.67 2007/05/20 23:33:06 kristerw Exp $
d21 1
d73 1
d76 1
d80 7
d95 2
a96 1
		sbin/pkg_add sbin/pkg_admin sbin/pkg_create       \
d109 2
d116 3
d123 3
a125 2
		man/man1/pkg_view.1 man/man1/linkfarm.1 man/cat7/packages.0  \
		etc/mk.conf )
@


1.67
log
@Add all packages that are used by pkgsrc/bootstrap to the list of
packages that should not be built on non-NetBSD systems.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.66 2007/01/28 19:23:22 kristerw Exp $
d85 1
a85 1
		sbin/mtree sbin/pkg_add sbin/pkg_admin sbin/pkg_create       \
d107 2
a108 2
		man/man1/pkg_view.1 man/man1/linkfarm.1 man/cat8/mtree.0     \
		man/man8/mtree.8 man/cat7/packages.0 etc/mk.conf )
d265 1
a265 1
	    pkgtools/tnftp pkgtools/mtree pkgtools/pax pkgtools/pkg_install \
@


1.66
log
@Remove old .bulk-not_available (NOT_AVAILABLE_FILE) files that are left
from previous run.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.65 2007/01/24 02:48:51 rillig Exp $
d264 3
a266 1
	    net/tnftp sysutils/install-sh textproc/nbsed; do
@


1.65
log
@Empty files are so ambiguous, so better leave a friendly message in the
STARTFILE.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.64 2006/12/15 13:15:06 martti Exp $
d37 5
d175 1
@


1.64
log
@Remove trailing tabs.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.63 2006/11/06 21:45:18 tv Exp $
d276 1
a276 1
touch "$STARTFILE"
@


1.63
log
@Also add bin/nawk to the tarred-up files.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.62 2006/11/06 21:08:43 tv Exp $
d138 1
a138 1
	
@


1.62
log
@Add lang/nawk and sysutils/install-sh to the "don't blow away" package
list for bulk builds.  (Revert previous on bootstrap; the PKG_PRESERVE
hack didn't work as expected.)
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.61 2006/10/02 16:37:22 dmcmahill Exp $
d91 3
a93 2
		bin/bmake bin/ftp bin/digest bin/nbsed bin/install-sh        \
		bin/pax bin/tar bin/cpio man/cat1/ftp.1 man/cat1/pax.0       \
@


1.61
log
@Change the quoting to let this work with solaris-2.9 /bin/sh.

The particular /bin/sh bug that was biting here is

  "${x}"/*/*/"$y"

doesn't expand the *'s if $y starts with a "." which, unfortunately, it
does.  Using

  "${x}"/*/*/$y

works correctly.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.60 2006/02/12 05:00:33 rillig Exp $
d256 2
a257 2
	for pkg in archivers/pax devel/bmake devel/mk-files net/tnftp \
	    textproc/nbsed; do
@


1.60
log
@The security/kth-krb4 package does not install bin/ftp anymore (since
February 2004), so it doesn't conflict with bootstrap-pkgsrc.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.59 2006/02/11 23:54:25 rillig Exp $
d168 1
a168 1
rm -f "${BULKFILESDIR}"/*/*/"$BROKENF" "${BULKFILESDIR}"/*/*/"$BRKWRKLOG" "${BULKFILESDIR}"/*/*/"$BLDLOG"
@


1.60.6.1
log
@Pullup ticket 1840 - requested by dmcmahill
portability fix for bulk build script

   Module Name:		pkgsrc
   Committed By:	dmcmahill
   Date:		Mon Oct  2 16:37:22 UTC 2006

   Modified Files:
   	pkgsrc/mk/bulk: pre-build

   Log Message:
   Change the quoting to let this work with solaris-2.9 /bin/sh.

   The particular /bin/sh bug that was biting here is

      "${x}"/*/*/"$y"

   doesn't expand the *'s if $y starts with a "." which, unfortunately, it
   does.  Using

      "${x}"/*/*/$y

   works correctly.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.61 2006/10/02 16:37:22 dmcmahill Exp $
d168 1
a168 1
rm -f "${BULKFILESDIR}"/*/*/$BROKENF "${BULKFILESDIR}"/*/*/$BRKWRKLOG "${BULKFILESDIR}"/*/*/$BLDLOG
@


1.59
log
@Added "pre-build>" identifier to two echo commands.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.58 2006/02/07 21:34:48 rillig Exp $
d257 1
a257 1
	    security/kth-krb4 textproc/nbsed; do
@


1.58
log
@When in "set -e" mode, the Solaris /bin/sh exits when "cd" fails, even
if it occurs as the condition of a "while" or "if", or in combination
with && or ||. This, of course, introduces a race condition if someone
removes the directory between the two "cd"s. The result would be that
the bulk build terminates, but that's not a big issue, as in this case
there must be something much more severely broken.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.57 2006/01/29 23:07:04 rillig Exp $
d72 1
a72 1
       echo 'done.'
d74 1
a74 1
       echo '(skipped)'
@


1.57
log
@Don't test(1) and cd(1), cd(1) directly. As long as "set -e" is not
activated this prevents unexpected behavior.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.56 2005/12/08 21:21:15 rillig Exp $
d114 5
a118 1
	if cd "$dbdir" 1>/dev/null 2>&1; then
@


1.56
log
@Prefixed all status messages with "pre-build>" to show the user where they
come from.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.55 2005/12/06 09:15:29 rillig Exp $
d114 1
a114 2
	if [ -d "$dbdir" ]; then
		cd "$dbdir"
@


1.55
log
@Added missing "quotes" around many variables.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.54 2005/12/03 01:00:37 rillig Exp $
d29 1
a29 1
	echo "Had problems determining the directory of .broken* files"
d34 1
a34 1
	echo "Had problems determining the name of the .broken files"
d39 1
a39 1
	echo "Had problems determining the name of the .broken.work files"
d44 1
a44 1
	echo "Had problems determining the name of the .make files"
d49 1
a49 1
	echo "Had problems determining the name of the .lintpkgsrc.db file"
d54 1
a54 1
	echo "Had problems determining the name of the .start file"
d63 1
a63 1
echo "Creating ${BULKFILESDIR} if necessary"
d67 1
a67 1
echo "Making sure vulnerability-list is upto date:"
d113 1
a113 1
	echo "Removing all installed packages in ${dbdir}"
d119 1
a119 1
				echo "${PKG_TOOLS_BIN}/pkg_delete -r ${pkg}"
d130 1
a130 1
				echo "${PKG_TOOLS_BIN}/pkg_delete -f ${pkg}"
d164 1
a164 1
echo "Cleaning up leftover state files from previous runs"
d183 1
a183 1
	echo "Creating lintpkgsrc cache database."
d186 1
a186 1
	echo "done."
d195 1
a195 1
	echo "Removing old/broken distfiles"
d197 1
a197 1
	echo "done."
d200 1
a200 1
	echo "Skipping distfile pruning."
d206 1
a206 1
	echo "Removing old (out of date) binary packages"
d208 1
a208 1
	echo "done."
d211 1
a211 1
	echo "Skipping packages pruning."
d217 1
a217 1
	echo "Checking for and removing orphaned packages links"
d222 1
a222 1
			echo "Removing orphaned link: \"$f\""
d226 1
a226 1
	echo "done."
d229 1
a229 1
	echo "Skipping pruning of packages links."
d236 1
a236 1
	echo "Removing all installed packages in ${dbdir}"
d242 1
a242 1
				echo "${PKG_TOOLS_BIN}/pkg_delete -r ${pkg}"
@


1.54
log
@Removed CVS_USER, as announced on pkgsrc-bulk.

See <http://mail-index.netbsd.org/pkgsrc-bulk/2005/11/24/0003.html>.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.53 2005/11/30 17:31:06 joerg Exp $
d69 3
a71 3
       ( cd ${USR_PKGSRC}/security/audit-packages                       \
         && ${BMAKE} bulk-install                                       \
         && env PKGVULNDIR=${DISTDIR} download-vulnerability-list )
d79 1
a79 1
	( cd $LOCALBASE && tar cf /tmp/$$.tar                                \
d108 3
a110 3
PKG_DBDIR=`(cd ${PKGLINT_PKG_DIR}; ${BMAKE} show-var VARNAME=PKG_DBDIR)`
DEPOTBASE=`(cd ${PKGLINT_PKG_DIR}; ${BMAKE} show-var VARNAME=DEPOTBASE)`
PKG_TOOLS_BIN=`(cd ${PKGLINT_PKG_DIR}; ${BMAKE} show-var VARNAME=PKG_TOOLS_BIN)`
d112 1
a112 1
for dbdir in ${PKG_DBDIR} ${DEPOTBASE}; do
d114 2
a115 2
	if [ -d $dbdir ]; then
		cd $dbdir
d118 1
a118 1
			if `${PKG_TOOLS_BIN}/pkg_info -K $dbdir -qe $pkg`; then
d120 1
a120 1
				${PKG_TOOLS_BIN}/pkg_delete -K $dbdir -r $pkg
d129 1
a129 1
			if `${PKG_TOOLS_BIN}/pkg_info -K $dbdir -qe $pkg`; then
d131 1
a131 1
				${PKG_TOOLS_BIN}/pkg_delete -K $dbdir -f $pkg
d142 1
a142 1
cd $LOCALBASE && rm -fr * && rm -fr .??*;
d144 1
a144 1
	( cd $LOCALBASE && tar xf /tmp/$$.tar )
d148 4
a151 4
rm -fr $X11BASE/share/gimp
rm -fr $X11BASE/share/gnome
rm -fr $X11BASE/share/kde
rm -fr $X11BASE/share/netscape
d153 1
a153 1
rm -fr $X11BASE/lib/libgimp*	# gimp doesn't build with old libs around
d163 1
a163 1
cd ${USR_PKGSRC}
d172 1
a172 1
PACKAGES=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=PACKAGES )`;
d177 1
a177 1
	( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install )
d184 1
a184 1
	lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -E $LINTPKGSRC_DB
d196 1
a196 1
	lintpkgsrc $lintpkgsrc_cache -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -o -m -r
d207 1
a207 1
	lintpkgsrc $lintpkgsrc_cache -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -p -r
d218 1
a218 1
	find $PACKAGES -type l -print |  \
d221 3
a223 3
		if [ ! -d $f -a ! -f $f ]; then
			echo "Removing orphaned link:  \"$f\""
			rm $f
d235 1
a235 1
for dbdir in ${PKG_DBDIR} ${DEPOTBASE}; do
d237 2
a238 2
	if [ -d $dbdir ]; then
		cd $dbdir
d241 1
a241 1
			if `${PKG_TOOLS_BIN}/pkg_info -K $dbdir -qe $pkg`; then
d243 1
a243 1
				${PKG_TOOLS_BIN}/pkg_delete -K $dbdir -r $pkg
d256 2
a257 2
		echo "Don't blow away bootstrap-pkgsrc stuff!" > \
		"${BULKFILESDIR}/${pkg}/${BROKENF}"
d261 1
a261 1
cd ${USR_PKGSRC}
d268 2
a269 2
if [ ! -d ${PKG_DBDIR} ]; then
	mkdir -p ${PKG_DBDIR}
d272 1
a272 1
touch $STARTFILE
@


1.53
log
@Fix usage of BULKFILESDIR:
1. Ensure that it exists before trying to use anything inside of it.
2. Prefix files correctly with BULKFILESDIR to match the rest of
the tree.
3. Most importantly, create the .broken.html files for bootstrap tools
in BULKFILESDIR, otherwise e.g. bmake would be removed in the middle of
a bulk build on non-NetBSD.

Discussed-with: rillig@@
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.52 2005/11/20 15:25:39 rillig Exp $
d11 1
a11 1
# Pull in USR_PKGSRC, CVS_USER:
a168 25


#
# Install cvs package and do a cvs update here
#
if [ "$CVS_USER" != "" ]; then
	if [ ! -f /usr/bin/cvs ]; then
		echo "Installing required cvs pkgs for CVS update"
		( cd ${USR_PKGSRC}/devel/cvs ; ${BMAKE} bulk-install )
	fi
	if [ ! -f /usr/bin/ssh ]; then
		echo "Installing required ssh pkgs for CVS update"
		( cd ${USR_PKGSRC}/security/ssh ; ${BMAKE} bulk-install )
	fi
	echo "Performing CVS update - this will take some time"
	su - ${CVS_USER} -c "stty sane ; cd ${USR_PKGSRC} ;                  \
		env CVS_RSH=ssh cvs -q update -Pd ${CVS_FLAGS} || exit 0"
        if [ $? != 0 ]
        then
                echo "CVS update not successful, aborting."
                exit 1
        fi
	echo "CVS update done."
fi

@


1.52
log
@Added "" quotes to all arguments to echo(1).
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.51 2005/11/20 14:55:13 rillig Exp $
d27 5
d62 4
d165 2
a166 2
rm -f */*/$BROKENF */*/$BRKWRKLOG */*/$BLDLOG
rm -f $BROKENF $BRKWRKLOG $BLDLOG $STARTFILE
a273 2
cd ${USR_PKGSRC}

d280 1
d282 1
a282 1
		${pkg}/${BROKENF}
d286 2
@


1.51
log
@Moved the "export BROKENF" command from the top of the program to the
point where it is actually used, which is when mk/bulk/pre-build.local
is executed for allowing user-specific modifications before the build
begins. That way it's easier to see why this command is necessary at
all.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.50 2005/08/26 07:24:53 reed Exp $
d13 1
a13 1
    . $BULK_BUILD_CONF
d104 1
a104 1
	echo Removing all installed packages in $dbdir
d110 1
a110 1
				echo ${PKG_TOOLS_BIN}/pkg_delete -r $pkg
d121 1
a121 1
				echo ${PKG_TOOLS_BIN}/pkg_delete -f $pkg
d155 1
a155 1
echo Cleaning up leftover state files from previous runs
d167 1
a167 1
		echo Installing required cvs pkgs for CVS update
d171 1
a171 1
		echo Installing required ssh pkgs for CVS update
d174 1
a174 1
	echo Performing CVS update - this will take some time
d179 1
a179 1
                echo CVS update not successful, aborting.
d182 1
a182 1
	echo CVS update done.
d202 1
a202 1
	echo done.
d213 1
a213 1
	echo done.
d224 1
a224 1
	echo done.
d242 1
a242 1
	echo done.
d252 1
a252 1
	echo Removing all installed packages in $dbdir
d258 1
a258 1
				echo ${PKG_TOOLS_BIN}/pkg_delete -r $pkg
@


1.50
log
@Use PKG_TOOLS_BIN, so it doesn't run wrong pkg_* tools found in the PATH.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.49 2005/08/26 07:19:05 reed Exp $
a27 1
export BROKENF
d279 1
@


1.49
log
@Create intermediate directories as required when creating PKG_DBDIR.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.48 2005/06/10 13:09:07 sketch Exp $
d102 1
d110 3
a112 3
			if `pkg_info -K $dbdir -qe $pkg`; then
				echo pkg_delete -r $pkg
				pkg_delete -K $dbdir -r $pkg
d121 3
a123 3
			if `pkg_info -K $dbdir -qe $pkg`; then
				echo pkg_delete -f $pkg
				pkg_delete -K $dbdir -f $pkg
d258 3
a260 3
			if `pkg_info -K $dbdir -qe $pkg`; then
				echo pkg_delete -r $pkg
				pkg_delete -K $dbdir -r $pkg
@


1.48
log
@mk.conf needs to be backed up as part of the bootstrap files.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.47 2005/03/31 23:36:15 reed Exp $
d283 1
a283 1
	mkdir ${PKG_DBDIR}
@


1.47
log
@The last revision to this file added a check for removing packages.
If they existed, it cd to that package database directory.

This broke the code later which assumed to be running from
the pkgsrc directory.

So cd to the USR_PKGSRC after this.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.46 2005/03/30 20:21:07 kristerw Exp $
d94 1
a94 1
		man/man8/mtree.8 man/cat7/packages.0 )
@


1.46
log
@Remove the packages added when pruning files etc. before starting
the real bulk build.  This ensures that the bulk build is started
in a consistent state, regardless of how the pre-build things are
configured.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.45 2005/03/29 00:55:50 hubertf Exp $
d265 2
@


1.45
log
@Run download-vulnerability-list before bulk-builds if
UPDATE_VULNERABILITY_LIST is set to 'yes' in pkgsrc/mk/bulk/build.conf.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.44 2005/01/19 20:58:01 tv Exp $
d249 16
@


1.44
log
@* Add USE_BULK_TIMESTAMPS (default "yes") to control whether dependency
  binpkg timestamps, and ${PKGDIR} file timestamps, will be used to
  determine if a rebuild is necessary.  If changed to "no", then rebuilds
  will only happen when PKGNAME actually changes.

* Add LINTPKGSRC_DB (and companion USE_LINTPKGSRC_CACHE, default "no") to
  make pre-build generate a reusable database with "lintpkgsrc -E"; helps
  with nfs-mounted pkgsrc.  A future change will allow use of this in the
  upload script.

* Add entry for PRUNEPACKAGES in build.conf-example (this was missing).
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.43 2005/01/18 15:04:34 tv Exp $
d56 12
a187 1
DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=DISTDIR )`;
@


1.43
log
@Turn distfile pruning back off by suggestion of wiz@@.  It's only binpkg
pruning that needs to be on by default.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.42 2005/01/18 14:11:11 tv Exp $
d43 5
d179 19
d201 1
a201 2
	( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install )
	lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -o -m -r
d212 1
a212 2
	( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install )
	lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -p -r
@


1.42
log
@Turn on all pruning by default.  This avoids problems with @@blddep matching
in the current incarnation of pkg_install.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.41 2005/01/11 18:33:16 tv Exp $
d18 1
a18 1
PRUNEDISTFILES=${PRUNEDISTFILES:-"yes"}
@


1.41
log
@Some shells can cache * lookups, so do all the rm -f's of */*/<something>
on one line.  Add a message prior to doing the leftover log cleanup, as
it will take a while if pkgsrc is on nfs.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.40 2004/11/16 18:34:12 jlam Exp $
d18 3
a20 3
PRUNEDISTFILES=${PRUNEDISTFILES:-"no"}
PRUNEPACKAGES=${PRUNEPACKAGES:-"no"}
PRUNELINKS=${PRUNEPACKAGES:-"no"}
@


1.40
log
@Preserve the .work.log file from a broken build as .broken.work.html
in the package directory, and add a link to it from .broken.html at
the point where the build fails.  Also adjust the auxilliary scripts
to handle/cleanup .broken.work.html files.

This should enhance the ability of developers to debug broken builds
by providing important information about what is happening as a build
progresses and fails.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.39 2004/04/19 23:09:55 seb Exp $
d138 3
a140 4
rm -f $BROKENF */*/$BROKENF
rm -f $BRKWRKLOG */*/$BRKWRKLOG
rm -f $BLDLOG */*/$BLDLOG
rm -f $STARTFILE
@


1.40.2.1
log
@sync with HEAD
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.40 2004/11/16 18:34:12 jlam Exp $
d138 4
a141 3
echo Cleaning up leftover state files from previous runs
rm -f */*/$BROKENF */*/$BRKWRKLOG */*/$BLDLOG
rm -f $BROKENF $BRKWRKLOG $BLDLOG $STARTFILE
@


1.40.2.2
log
@sync with HEAD
@
text
@d2 1
a2 1
# $NetBSD$
d19 2
a20 2
PRUNEPACKAGES=${PRUNEPACKAGES:-"yes"}
PRUNELINKS=${PRUNEPACKAGES:-"yes"}
a42 5
LINTPKGSRC_DB=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=LINTPKGSRC_DB )`;
if [ "$LINTPKGSRC_DB" = "" ]; then
	echo "Had problems determining the name of the .lintpkgsrc.db file"
	exit 1
fi
a173 19
case "$LINTPKGSRC_CACHE$PRUNEDISTFILES$PRUNEPACKAGES" in
*yes*|*YES*)
	# install pkglint to support any of these options
	( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install )
	;;
esac

case "$LINTPKGSRC_CACHE" in
yes|YES)
	echo "Creating lintpkgsrc cache database."
	lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -E $LINTPKGSRC_DB
	lintpkgsrc_cache="-I $LINTPKGSRC_DB"
	echo done.
	;;
*)
	lintpkgsrc_cache=''
	;;
esac

d177 2
a178 1
	lintpkgsrc $lintpkgsrc_cache -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -o -m -r
d189 2
a190 1
	lintpkgsrc $lintpkgsrc_cache -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -p -r
@


1.40.2.3
log
@sync [all but bsd.pkg.mk] with HEAD
@
text
@a55 12
DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=DISTDIR )`;

# Make sure the pkg-vulnerabilities file is up to date
echo "Making sure vulnerability-list is upto date:"
if [ -z "$UPDATE_VULNERABILITY_LIST" -o "$UPDATE_VULNERABILITY_LIST" = yes ]; then
       ( cd ${USR_PKGSRC}/security/audit-packages                       \
         && ${BMAKE} bulk-install                                       \
         && env PKGVULNDIR=${DISTDIR} download-vulnerability-list )
       echo 'done.'
else
       echo '(skipped)'
fi
d176 1
a237 18
# Clean out the packages added above so that the real bulk build
# is started in a consistent state.
for dbdir in ${PKG_DBDIR} ${DEPOTBASE}; do
	echo Removing all installed packages in $dbdir
	if [ -d $dbdir ]; then
		cd $dbdir
		for pkg in *
		do
			if `pkg_info -K $dbdir -qe $pkg`; then
				echo pkg_delete -r $pkg
				pkg_delete -K $dbdir -r $pkg
			fi
		done
	fi
done

cd ${USR_PKGSRC}

@


1.40.2.4
log
@EOL the tv-derecurse branch; it has become too outdated.  The last live
revision can be fetched at the tv-derecurse-eol tag.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.40.2.3 2005/05/17 18:29:45 tv Exp $
@


1.39
log
@Fix pasto.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.38 2004/04/09 18:43:14 jschauma Exp $
d33 5
d139 1
@


1.38
log
@Commentary cleanup:
- If it's a full sentence, start capitalize first letter and end with a
  period.
- Break comments at ~80 chars so it fits into a terminal.[*]

(* This should be done for the code as well, but then it'll need testing.
   I'll do this at another point in time.)
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.37 2004/04/09 18:29:37 jschauma Exp $
d39 1
a39 1
if [ "$BLDLOG" = "" ]; then
@


1.37
log
@On some systems, bootstrap also installs ${LOCALBASE}/bin/install-sh --
if that is removed, the bulk-build will fail immediately.  So tar it up,
too.  (Note that this will give a warning on systems that don't have it.)
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.36 2004/02/14 04:06:29 grant Exp $
d24 3
a26 2
# extract the name of the files used for the build log and broken build log.
# these have defaults set by bsd.bulk-pkg.mk and may be overridden in /etc/mk.conf
d49 5
a53 5
	( cd $LOCALBASE && tar cf /tmp/$$.tar \
		sbin/mtree sbin/pkg_add sbin/pkg_admin sbin/pkg_create \
		sbin/pkg_delete sbin/pkg_info sbin/pkg_view sbin/linkfarm \
		share/mk/sys.mk share/mk/bsd.dep.mk share/mk/bsd.depall.mk \
		share/mk/bsd.files.mk share/mk/bsd.hostprog.mk \
d55 17
a71 17
		share/mk/bsd.kernobj.mk share/mk/bsd.kinc.mk \
		share/mk/bsd.kmod.mk share/mk/bsd.lib.mk \
		share/mk/bsd.links.mk share/mk/bsd.man.mk \
		share/mk/bsd.nls.mk share/mk/bsd.obj.mk \
		share/mk/bsd.prog.mk share/mk/bsd.subdir.mk \
		share/mk/bsd.sys.mk share/mk/bsd.own.mk \
		bin/bmake bin/ftp bin/digest bin/nbsed bin/install-sh \
		bin/pax bin/tar bin/cpio man/cat1/ftp.1 man/cat1/pax.0 \
		man/cat1/tar.0 man/cat1/cpio.0 man/cat1/pkg_add.0 \
		man/cat1/pkg_admin.0 man/cat1/pkg_create.0 \
		man/cat1/pkg_delete.0 man/cat1/pkg_info.0 \
		man/cat1/pkg_view.0 man/cat1/linkfarm.0 \
		man/man1/digest.1 man/man1/pax.1 man/man1/cpio.1 \
		man/man1/tar.1 man/man1/nbsed.1 man/man1/pkg_add.1 \
		man/man1/pkg_admin.1 man/man1/pkg_create.1 \
		man/man1/pkg_delete.1 man/man1/pkg_info.1 \
		man/man1/pkg_view.1 man/man1/linkfarm.1 man/cat8/mtree.0 \
d153 2
a154 1
	su - ${CVS_USER} -c "stty sane ; cd ${USR_PKGSRC} ; env CVS_RSH=ssh cvs -q update -Pd ${CVS_FLAGS} || exit 0"
@


1.36
log
@zoularis is deprecated, don't backup zoularis.mk.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.35 2004/01/20 12:44:30 grant Exp $
d60 1
a60 1
		bin/bmake bin/ftp bin/digest bin/nbsed \
@


1.35
log
@add archivers/pax, net/tnftp, security/kth-krb4 and textproc/nbsed to
the packages to skip on non-NetBSD because they blow away
bootstrap-pkgsrc installed files.

only create ${PKG_DBDIR} if it doesn't already exist.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.34 2004/01/15 09:57:50 grant Exp $
d60 1
a60 1
		share/mk/zoularis.mk bin/bmake bin/ftp bin/digest bin/nbsed \
@


1.34
log
@'export VAR=value' doesn't work in some brain-dead shells. use
'VAR=value; export VAR' instead.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.33 2003/12/07 11:43:22 agc Exp $
d213 5
a217 4
	echo "Don't blow away bootstrap-pkgsrc stuff!" > \
		devel/bmake/${BROKENF}
	echo "Don't blow away bootstrap-pkgsrc stuff!" > \
		devel/mk-files/${BROKENF}
d224 3
a226 1
mkdir ${PKG_DBDIR}
a228 1

@


1.33
log
@Make the cvs update work for all shells, not just csh.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.32 2003/11/28 22:46:48 hubertf Exp $
d26 2
a27 1
export BROKENF=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BROKENFILE )`;
@


1.32
log
@Catch if the user given to "su" is bogus/non-existing, but if
the "cvs" command inside the su returns an error, that should be ignored.
(Aparently cvs returns "1" even if it's done a successful update but if
there were some files removed on purpose).
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.31 2003/11/20 00:02:59 hubertf Exp $
d151 1
a151 1
	su - ${CVS_USER} -c "stty sane ; setenv CVS_RSH ssh ; cd ${USR_PKGSRC} ; cvs -q update -Pd ${CVS_FLAGS} || exit 0"
@


1.31
log
@Catch error from su, and report it to the calling script (pkgsrc/mk/build)
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.30 2003/09/16 17:21:36 grant Exp $
d151 1
a151 1
	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd '"${CVS_FLAGS}"
@


1.30
log
@apply patch from Jonathan Perkin on tech-pkg@@, bringing the list of
files to preserve in sync with reality.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.29 2003/09/02 07:00:06 jlam Exp $
d152 5
a158 1

@


1.29
log
@Merge pkgviews-mk branch into the HEAD by running:

	cd pkgsrc/mk
	cvs update -Pd -A
	cvs update -Pd -j pkgviews-mk-base -j pkgviews-mk
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.27.2.6 2003/08/31 08:12:38 jlam Exp $
d48 3
a50 3
        	sbin/mtree sbin/pkg_add sbin/pkg_admin sbin/pkg_create \
		sbin/pkg_delete sbin/pkg_info share/mk/sys.mk \
		share/mk/bsd.dep.mk share/mk/bsd.depall.mk \
d52 1
a52 1
		share/mk/bsd.inc.mk share/mk/bsd.info.mk \
d59 1
a59 1
		share/mk/zoularis.mk bin/bmake bin/ftp bin/digest \
d64 7
a70 2
		man/man1/digest.1 man/cat8/mtree.0 \
		man/cat7/packages.0 )
@


1.28
log
@Clean up a few things in /tmp before building
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.27 2003/06/06 18:28:47 jschauma Exp $
d72 1
d74 22
a95 20
echo Removing all installed packages in ${PKG_DBDIR}

if [ -d ${PKG_DBDIR} ]; then
	cd ${PKG_DBDIR}
	for pkg in *
	do
		if `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then
			echo pkg_delete -r $pkg
			env PKG_DBDIR=${PKG_DBDIR} pkg_delete -r $pkg
		fi
	done
	# this should have removed everything.  Now force any broken pkgs
	# to deinstall
	for pkg in *
	do
		if `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then
			echo pkg_delete -f $pkg
			env PKG_DBDIR=${PKG_DBDIR} pkg_delete -f $pkg
		fi
	done
d97 6
a102 5
	# We've tried our best to get rid of the pkgs, now do it the hard way
	# If it wasn't for stuff in $X11BASE, I wouldn't have hard feelings
	# about this!
	rm -fr *
fi
@


1.27
log
@If we want to try a bulk-build on a non-NetBSD platform, we need to take
care not to blow away our bootstrap-pkgsrc stuff in the initial phase.
Also mark devel/bmake and devel/mk-files as broken on non-NetBSD so as not
to blow away our precious files from the bootstrap process in the middle
of a bulk-build.  Now let's see if bulk-building works on Linux...
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.26 2003/05/06 17:42:04 jmmv Exp $
d116 2
@


1.27.2.1
log
@Use the 20030819 pkg_install tools, which support PKG_DBDIR_DFLT, and
modify pkgsrc to use the new variable.  This greatly simplifies a lot of
the code instead of having to overload the value of PKG_DBDIR as we did
before this change.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.27 2003/06/06 18:28:47 jschauma Exp $
a71 1
DEPOTBASE=`(cd ${PKGLINT_PKG_DIR}; ${BMAKE} show-var VARNAME=DEPOTBASE)`
d79 1
a79 4
		if `env PKG_DBDIR=${DEPOTBASE} pkg_info -qe $pkg`; then
			echo pkg_delete -r $pkg
			env PKG_DBDIR=${DEPOTBASE} pkg_delete -r $pkg
		elif `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then
d88 1
a88 4
		if `env PKG_DBDIR=${DEPOTBASE} pkg_info -qe $pkg`; then
			echo pkg_delete -f $pkg
			env PKG_DBDIR=${DEPOTBASE} pkg_delete -f $pkg
		elif `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then
@


1.27.2.2
log
@Require version 20030820 of the pkg_install tools to use the new -K and -k
flags to specify package database directories, instead of setting up a
shell environment for the pkg_install tools.  The latter was more prone to
error.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.27.2.1 2003/08/21 02:06:17 jlam Exp $
d80 1
a80 1
		if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
d82 2
a83 2
			pkg_delete -K ${DEPOTBASE} -r $pkg
		elif `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
d85 1
a85 1
			pkg_delete -K ${PKG_DBDIR} -r $pkg
d92 1
a92 1
		if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
d94 2
a95 2
			pkg_delete -K ${DEPOTBASE} -f $pkg
		elif `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
d97 1
a97 1
			pkg_delete -K ${PKG_DBDIR} -f $pkg
@


1.27.2.3
log
@Sync to HEAD
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.28 2003/08/26 08:18:09 hubertf Exp $
a122 2
rm -fr /tmp/config-guess-*
rm -fr /tmp/mod*
@


1.27.2.4
log
@Check to see if DEPOTBASE is different from PKG_DBDIR as an optimization.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.27.2.3 2003/08/26 21:58:07 jlam Exp $
d80 4
a83 11
		case "${DEPOTBASE}" in
		"${PKG_DBDIR}")
			;;
		*)
			if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
				echo pkg_delete -r $pkg
				pkg_delete -K ${DEPOTBASE} -r $pkg
			fi
			;;
		esac
		if `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
d92 4
a95 11
		case "${DEPOTBASE}" in
		"${PKG_DBDIR}")
			;;
		*)
			if `pkg_info -K ${DEPOTBASE} -qe $pkg`; then
				echo pkg_delete -f $pkg
				pkg_delete -K ${DEPOTBASE} -f $pkg
			fi
			;;
		esac
		if `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
@


1.27.2.5
log
@Actually, make sure that we don't try to remove broken packages on the
first time around.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.27.2.4 2003/08/31 06:37:16 jlam Exp $
a81 4
			if `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
				echo pkg_delete -r $pkg
				pkg_delete -K ${PKG_DBDIR} -r $pkg
			fi
a86 3
			elif `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
				echo pkg_delete -r $pkg
				pkg_delete -K ${PKG_DBDIR} -r $pkg
d90 4
a100 4
			if `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
				echo pkg_delete -f $pkg
				pkg_delete -K ${PKG_DBDIR} -f $pkg
			fi
a105 3
			elif `pkg_info -K ${PKG_DBDIR} -qe $pkg`; then
				echo pkg_delete -f $pkg
				pkg_delete -K ${PKG_DBDIR} -f $pkg
d109 4
@


1.27.2.6
log
@Okay, now that I've read the file and actually understand what it's trying
to do, rewrite the package removal as a loop over ${PKG_DBDIR} then
${DEPOTBASE}.  This causes all "overwrite" and package instances in the
default view to be removed first, followed by any depoted packages.  Since
removing a depoted package triggers removing package instances in all
other views, this should guarantee that all traces of pkgviews packages are
removed from the system.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.27.2.5 2003/08/31 06:39:36 jlam Exp $
d74 18
a91 7
for dbdir in ${PKG_DBDIR} ${DEPOTBASE}; do
	echo Removing all installed packages in $dbdir
	if [ -d $dbdir ]; then
		cd $dbdir
		for pkg in *
		do
			if `pkg_info -K $dbdir -qe $pkg`; then
d93 1
a93 1
				pkg_delete -K $dbdir -r $pkg
d95 10
a104 8
		done
		#
		# this should have removed everything.
		# Now force any broken pkgs to deinstall.
		#
		for pkg in *
		do
			if `pkg_info -K $dbdir -qe $pkg`; then
d106 1
a106 1
				pkg_delete -K $dbdir -f $pkg
d108 12
a119 1
		done
d121 5
a125 6
		# We've tried our best to get rid of the pkgs, now do it
		# the hard way.  If it wasn't for stuff in $X11BASE, I
		# wouldn't have hard feelings about this!
		rm -fr *
	fi
done
@


1.26
log
@Drop trailing whitespace.  Ok'ed by wiz.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.25 2002/11/03 22:59:21 hubertf Exp $
d42 2
d45 22
d100 4
a103 5
LOCALBASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=LOCALBASE )`;
X11BASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=X11BASE )`;
	
# General cleanout - easy!
cd $LOCALBASE && rm -fr * && rm -fr .??*
d193 9
@


1.25
log
@Actually pass CVS_FLAGS propperly to the su'd "cvs update"
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.24 2002/08/22 08:21:31 jlam Exp $
d47 1
a47 1
PKG_DBDIR=`(cd ${PKGLINT_PKG_DIR}; ${BMAKE} show-var VARNAME=PKG_DBDIR)` 
d55 1
a55 1
		if `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then 
d64 1
a64 1
		if `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then 
d156 1
a156 1
	while read f 
@


1.24
log
@Merge pkgsrc/mk from the buildlink2 branch back into the main trunk.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.18.2.2 2002/08/21 22:01:37 jlam Exp $
d117 1
a117 1
	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd ${CVS_FLAGS}'
@


1.23
log
@Add CVS_FLAGS that will be passed to 'cvs update' before builds.
Allows specifying a branch ("-rnetbsd-1-6") or the trunk ("-A") easily
from the build.conf file.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.22 2002/08/07 10:56:12 agc Exp $
@


1.22
log
@Make these scripts useful on platforms other than NetBSD by using a BMAKE
environment variable, which contains the name of the make(1) program to
invoke - suggestion by Julien Letessier some time ago, the confusion mine,
since I thought he was referring to something else completely.

Don't rely on there being a POSIX tr(1) in the path by default - test
explicitly for both "yes" and "YES".

Set the default for PRUNEDISTFILES to "no", since we can't assume that
the user wants us to delete something which he may have been keeping
around, and there are other ways of accomplishing this aim (lintpkgsrc
-o, for example).

Clean up some superfluous white space at the end of lines.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.21 2002/06/29 03:33:35 dmcmahill Exp $
d117 1
a117 1
	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd'
@


1.22.4.1
log
@Pull up 1.23, requested by hubertf:
Add CVS_FLAGS that will be passed to 'cvs update' before builds.
Allows specifying a branch ("-rnetbsd-1-6") or the trunk ("-A") easily
from the build.conf file.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.22 2002/08/07 10:56:12 agc Exp $
d117 1
a117 1
	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd ${CVS_FLAGS}'
@


1.21
log
@don't hard code the start time stamp file as .start.${arch} but allow
OBJMACHINE and OBJHOSTNAME to work.  Also don't hardcode /usr/pkg and
/usr/X11R6 for LOCALBASE and X11BASE.  Finally, fix a few typos in messages
while here.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.20 2002/06/28 08:46:38 agc Exp $
d18 1
a18 1
PRUNEDISTFILES=${PRUNEDISTFILES:-"yes"}
a20 3
PRUNEDISTFILES=`echo $PRUNEDISTFILES | tr "[:lower:]" "[:upper:]"`
PRUNEPACKAGES=`echo $PRUNEPACKAGES | tr "[:lower:]" "[:upper:]"`
PRUNELINKS=`echo $PRUNELINKS | tr "[:lower:]" "[:upper:]"`
d26 1
a26 1
export BROKENF=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=BROKENFILE )`;
d31 1
a31 1
BLDLOG=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=BUILDLOG )`;
d36 1
a36 1
STARTFILE=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=STARTFILE )`;
d47 1
a47 1
PKG_DBDIR=`(cd ${PKGLINT_PKG_DIR}; make show-var VARNAME=PKG_DBDIR)` 
d76 2
a77 2
LOCALBASE=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=LOCALBASE )`;
X11BASE=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=X11BASE )`;
d110 1
a110 1
		( cd ${USR_PKGSRC}/devel/cvs ; make bulk-install )
d114 1
a114 1
		( cd ${USR_PKGSRC}/security/ssh ; make bulk-install )
d125 2
a126 2
DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=DISTDIR )`;
PACKAGES=`( cd ${PKGLINT_PKG_DIR} ; make show-var VARNAME=PACKAGES )`;
d128 2
a129 1
if [ $PRUNEDISTFILES = "YES" ]; then
d131 1
a131 1
	( cd ${PKGLINT_PKG_DIR} ; make PRECLEAN=yes bulk-install )
d134 2
a135 1
else
d137 2
a138 1
fi
d140 2
a141 1
if [ $PRUNEPACKAGES = "YES" ]; then
d143 1
a143 1
	( cd ${PKGLINT_PKG_DIR} ; make PRECLEAN=yes bulk-install )
d146 2
a147 1
else
d149 2
a150 1
fi
d152 2
a153 1
if [ $PRUNELINKS = "YES" ]; then
d164 2
a165 1
else
d167 2
a168 1
fi
@


1.20
log
@fix typo
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.19 2002/06/28 07:54:36 agc Exp $
d31 1
a31 1
	echo "Had problems determining the name of the .broken.files"
d36 6
a41 1
	echo "Had problems determining the name of the .make.files"
d102 1
a102 1
rm -f .start.${arch}
d171 2
a172 1
touch .start.${arch}
@


1.19
log
@Don't hardcode the value /var/db/pkg - this may not be the desired value
of PKG_DBDIR. Instead, get the value using "make show-var".
Pass this value down through the environment to pkg_info and pkg_delete
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.18 2002/03/14 00:13:29 hubertf Exp $
d45 1
a45 1
PKG_DBDIR=`(cd ${PKGLINT_PKG_DIR}; make show-var VARNAME=PKG_DBDIR)` ;;
@


1.18
log
@nuke /var/wwwoffle - pointed out by fred bruckman
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.17 2001/07/21 19:58:32 dmcmahill Exp $
d25 2
d29 1
a29 1
export BROKENF=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=BROKENFILE )`;
d34 1
a34 1
BLDLOG=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=BUILDLOG )`;
d43 1
a43 1
# Clean out everything and it's mother
d45 3
a47 1
echo Removing all installed packages 
d49 2
a50 2
if [ -d /var/db/pkg ]; then
	cd /var/db/pkg
d53 1
a53 1
		if `pkg_info -qe $pkg`; then 
d55 1
a55 1
			pkg_delete -r $pkg
d62 1
a62 1
		if `pkg_info -qe $pkg`; then 
d64 1
a64 1
			pkg_delete -f $pkg
d74 2
a75 2
LOCALBASE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=LOCALBASE )`;
X11BASE=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=X11BASE )`;
d87 1
a87 1
rm -fr /nonexistant		# broken useradd on pop3d
d123 2
a124 2
DISTDIR=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=DISTDIR )`;
PACKAGES=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=PACKAGES )`;
d128 1
a128 1
	( cd ${USR_PKGSRC}/pkgtools/pkglint ; make PRECLEAN=yes bulk-install )
d137 1
a137 1
	( cd ${USR_PKGSRC}/pkgtools/pkglint ; make PRECLEAN=yes bulk-install )
d163 2
@


1.18.2.1
log
@Merge pkgsrc/mk from pkgsrc-current into the buildlink2 branch.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.23 2002/08/20 02:17:57 hubertf Exp $
d18 1
a18 1
PRUNEDISTFILES=${PRUNEDISTFILES:-"no"}
d21 3
a23 2

PKGLINT_PKG_DIR=${USR_PKGSRC}/pkgtools/pkglint
d27 1
a27 1
export BROKENF=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BROKENFILE )`;
d29 1
a29 6
	echo "Had problems determining the name of the .broken files"
	exit 1
fi
BLDLOG=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=BUILDLOG )`;
if [ "$BLDLOG" = "" ]; then
	echo "Had problems determining the name of the .make files"
d32 1
a32 1
STARTFILE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=STARTFILE )`;
d34 1
a34 1
	echo "Had problems determining the name of the .start file"
d41 1
a41 1
# Clean out everything and its mother
d43 1
a43 1
PKG_DBDIR=`(cd ${PKGLINT_PKG_DIR}; ${BMAKE} show-var VARNAME=PKG_DBDIR)` 
d45 2
a46 4
echo Removing all installed packages in ${PKG_DBDIR}

if [ -d ${PKG_DBDIR} ]; then
	cd ${PKG_DBDIR}
d49 1
a49 1
		if `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then 
d51 1
a51 1
			env PKG_DBDIR=${PKG_DBDIR} pkg_delete -r $pkg
d58 1
a58 1
		if `env PKG_DBDIR=${PKG_DBDIR} pkg_info -qe $pkg`; then 
d60 1
a60 1
			env PKG_DBDIR=${PKG_DBDIR} pkg_delete -f $pkg
d70 2
a71 2
LOCALBASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=LOCALBASE )`;
X11BASE=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=X11BASE )`;
d83 1
a83 1
rm -fr /nonexistent		# broken useradd on pop3d
d93 1
a93 1
rm -f $STARTFILE
d104 1
a104 1
		( cd ${USR_PKGSRC}/devel/cvs ; ${BMAKE} bulk-install )
d108 1
a108 1
		( cd ${USR_PKGSRC}/security/ssh ; ${BMAKE} bulk-install )
d111 1
a111 1
	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd ${CVS_FLAGS}'
d119 2
a120 2
DISTDIR=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=DISTDIR )`;
PACKAGES=`( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} show-var VARNAME=PACKAGES )`;
d122 1
a122 2
case "$PRUNEDISTFILES" in
yes|YES)
d124 1
a124 1
	( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install )
d127 1
a127 2
	;;
*)
d129 1
a129 2
	;;
esac
d131 1
a131 2
case "$PRUNEPACKAGES" in
yes|YES)
d133 1
a133 1
	( cd ${PKGLINT_PKG_DIR} ; ${BMAKE} PRECLEAN=yes bulk-install )
d136 1
a136 2
	;;
*)
d138 1
a138 2
	;;
esac
d140 1
a140 2
case "$PRUNELINKS" in
yes|YES)
d151 1
a151 2
	;;
*)
d153 1
a153 2
	;;
esac
d160 1
a160 4
mkdir ${PKG_DBDIR}

touch $STARTFILE

@


1.18.2.2
log
@Merge conflicts.
@
text
@@


1.17
log
@don't try and do 'mount -o async -u /usr' because we don't know that the user
even has a file system called /usr or that thats the right one.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.16 2001/05/09 03:05:24 hubertf Exp $
d86 1
@


1.16
log
@OK, let's try this the other way 'round: first clean out *everything*,
then start preparing the bulk build (cvs update, distfile cleanout, ...)
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.15 2001/05/05 14:01:09 dmcmahill Exp $
a43 1
mount -o async -u /usr
a93 1
mount -o noasync -u /usr
@


1.15
log
@when installing pkglint before the bulk build do it with PRECLEAN=yes.
This should fix pkg/12808.  Adding the PRECLEAN as a fix was suggested
by Hubert.

Also, while here don't hardcode LOCALBASE and X11BASE.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.14 2001/04/14 17:20:07 dmcmahill Exp $
a37 32
#
# Install cvs package and do a cvs update here
#
if [ "$CVS_USER" != "" ]; then
	if [ ! -f /usr/bin/cvs ]; then
		echo Installing required cvs pkgs for CVS update
		( cd ${USR_PKGSRC}/devel/cvs ; make bulk-install )
	fi
	if [ ! -f /usr/bin/ssh ]; then
		echo Installing required ssh pkgs for CVS update
		( cd ${USR_PKGSRC}/security/ssh ; make bulk-install )
	fi
	echo Performing CVS update - this will take some time
	su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd'
	echo CVS update done.
fi

#
# Remove old/broken distfiles and binary packages
#

DISTDIR=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=DISTDIR )`;
PACKAGES=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=PACKAGES )`;

if [ $PRUNEDISTFILES = "YES" ]; then
	echo "Removing old/broken distfiles"
	( cd ${USR_PKGSRC}/pkgtools/pkglint ; make PRECLEAN=yes bulk-install )
	lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -o -m -r
	echo done.
else
	echo "Skipping distfile pruning."
fi
a38 23
if [ $PRUNEPACKAGES = "YES" ]; then
	echo "Removing old (out of date) binary packages"
	( cd ${USR_PKGSRC}/pkgtools/pkglint ; make PRECLEAN=yes bulk-install )
	lintpkgsrc -K $PACKAGES -P $USR_PKGSRC -M $DISTDIR -p -r
	echo done.
else
	echo "Skipping packages pruning."
fi

if [ $PRUNELINKS = "YES" ]; then
	echo "Checking for and removing orphaned packages links"
	find $PACKAGES -type l -print |  \
	while read f 
	do
		if [ ! -d $f -a ! -f $f ]; then
			echo "Removing orphaned link:  \"$f\""
			rm $f
		fi
	done
	echo done.
else
	echo "Skipping pruning of packages links."
fi
d97 59
a155 1
touch .start.${arch}
d161 1
@


1.14
log
@allow for a pre-build.local script.  If mk/bulk/pre-build.local exists,
then run it at the end of pre-build.  This lets users do things like:

echo "I do not have enough disk space to build this pig." \
	> games/crafty-book-enormous/$BROKENF
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.13 2001/04/02 14:25:24 hubertf Exp $
d64 1
a64 1
	( cd ${USR_PKGSRC}/pkgtools/pkglint ; make bulk-install )
d73 1
a73 1
	( cd ${USR_PKGSRC}/pkgtools/pkglint ; make bulk-install )
d125 3
d130 1
a130 3
cd /usr/pkg
rm -fr *
rm -fr .??*
d133 4
a136 4
rm -fr /usr/X11R6/share/gimp
rm -fr /usr/X11R6/share/gnome
rm -fr /usr/X11R6/share/kde
rm -fr /usr/X11R6/share/netscape
d138 1
a138 1
rm -fr /usr/X11R6/lib/libgimp*	# gimp doesn't build with old libs around
@


1.13
log
@clean up a few more shards
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.12 2001/03/19 11:25:39 dmcmahill Exp $
d27 1
a27 1
BROKENF=`( cd $USR_PKGSRC/pkgtools/pkglint ; make show-var VARNAME=BROKENFILE )`;
d152 5
@


1.12
log
@-add support for a BULK_PREREQ make variable.  BULK_PREREQ contains a list
 of packages which must stay installed during the build, but are not pulled
 in by the DEPENDS for each package.  Currently, BULK_PREREQ will always include
 pkgtools/digest.  At this time, the primary use will be to add
 BULK_PREREQ+=pkgtools/xpkgwedge
 in /etc/mk.conf to do an xpkgwedge'd bulk build.  It is up to the user to make
 sure that the list of packages in BULK_PREREQ is a flattened list (ie all the
 DEPENDS are listed too).  Again, at this time, xpkgwedge is really the only
 package that should be added to the list.

-add an ADMINSIG build.conf variable.  This is the signature at the end of the
 email report.  Maybe now I'll quit forwarding reports signed as "-Hubert".

-while here, eliminate grep|awk lines and `grep >/dev/null` replacing them
 with pure awk and grep -q.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.11 2001/03/14 15:04:03 hubertf Exp $
d139 2
@


1.11
log
@make sure CVS_RSH gets set to 'ssh' before cvs updating
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.10 2001/02/01 08:25:39 dmcmahill Exp $
d19 5
d59 5
a63 2
if [ $PRUNEDISTFILES = "yes" -o $PRUNEDISTFILES = "YES" ]; then
	echo Removing old/broken distfiles and binary packages
d65 1
a65 1
	lintpkgsrc -r -P${USR_PKGSRC}
d71 24
d106 2
a107 2
			echo pkg_delete -rR $pkg
			pkg_delete -rR $pkg
d110 2
d115 2
a116 2
			echo pkg_delete -rR $pkg
			pkg_delete -rR -f $pkg
@


1.10
log
@- when deleting packages, don't try and delete packages which have already
  been deleted.

- when removing the '.start' file, don't remove them all, only the one we
  created.  Prevents clashes when pkgsrc is shared among multiple machines.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.9 2000/12/31 17:38:32 dmcmahill Exp $
d46 1
a46 1
	su - ${CVS_USER} -c 'stty sane ; cd '${USR_PKGSRC}' ; cvs -q update -Pd'
@


1.9
log
@move the code which determines the BROKENFILE and BUILDLOG file names out
of the top level build script and into the {pre,post}-build scripts.  This
ensures that either of those scripts may be run directly and not rely on
a variable being set by the top level script.

Thanks to Hubert Feyrer for pointing out the problem in a private email.

These changes do not require any user changes to the build.conf file and
should be transparent to the user.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.8 2000/12/30 14:53:28 dmcmahill Exp $
d73 4
a76 2
		echo pkg_delete -rR $pkg
		pkg_delete -rR $pkg
d80 4
a83 2
		echo pkg_delete -rR $pkg
		pkg_delete -rR -f $pkg
d111 1
a111 1
rm -f .start*
@


1.8
log
@further cleanup of handling the .broken.files and .make.files

- set BROKENF and BLDLOG in the 'build' script and pass those variables
  down to {pre,post}-build in the environment to make sure we only set them
  in one place.  The values are determined by a
      make show-var VARNAME=BROKENFILE
  This causes the default (set in bsd.bulk-pkg.mk) or the user overridden
  value from /etc/mk.conf or the environment to be correctly determined.  This
  is more robust that relying on a build.conf setting which may or may not be
  correctly set.

- have pre-build only clean up BROKENF and BLDLOG files instead of
  .broken* and .make*
  This avoids conflicts when pkgsrc is shared among different machines.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.7 2000/12/22 01:35:33 dmcmahill Exp $
d20 3
d24 1
a24 2
        echo "Error:  BROKENF must be set to the name of the .broken.files"
        echo "        This should have happened in the top level build script"
d27 1
d29 1
a29 2
        echo "Error:  BLDLOG must be set to the name of the .make.files"
        echo "        This should have happened in the top level build script"
@


1.7
log
@make the pruning of distfiles be controlled by a build.conf setting.
this way if you have 2 different pkgsrc trees sharing a distfiles directory
you don't nuke distfiles which may still be needed.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.6 2000/12/15 23:08:42 hubertf Exp $
d20 11
d103 2
a104 2
rm -f .broken* */*/.broken*
rm -f .make* */*/.make*
@


1.6
log
@An old version of a (broken) useradd created /nonexistang, and pop3d
didn't like this. Make sure it's nuked.
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.5 2000/12/05 16:33:27 hubertf Exp $
d18 1
d40 9
a48 4
echo Removing old/broken distfiles and binary packages
( cd ${USR_PKGSRC}/pkgtools/pkglint ; make bulk-install )
lintpkgsrc -r -P${USR_PKGSRC}
echo done.
@


1.5
log
@If cvs and ssh are in base, don't pkg_add them
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.4 2000/09/29 04:27:42 hubertf Exp $
d81 1
@


1.4
log
@Install cvs and ssh and do 'cvs update' only if CVS_USER is set in build.conf.
(Set to "" to prevent update e.g. on sparc64 where we don't have a working
ssh yet)
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.3 2000/09/24 16:22:08 hubertf Exp $
d23 8
a30 3
	echo Installing required pkgs for CVS update
	( cd ${USR_PKGSRC}/devel/cvs ; make bulk-install )
	( cd ${USR_PKGSRC}/security/ssh ; make bulk-install )
@


1.3
log
@make lintpkgsrc operate on the right dir - with out -P, it goes for
/usr/pkgsrc instead of the current dir. Bad!
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.2 2000/09/15 22:27:16 hubertf Exp $
d22 8
a29 6
echo Installing required pkgs for CVS update
( cd ${USR_PKGSRC}/devel/cvs ; make bulk-install )
( cd ${USR_PKGSRC}/security/ssh ; make bulk-install )
echo Performing CVS update - this will take some time
su - ${CVS_USER} -c 'stty sane ; cd '${USR_PKGSRC}' ; cvs -q update -Pd'
echo CVS update done.
@


1.2
log
@rcs id police
@
text
@d2 1
a2 1
# $NetBSD: pre-build,v 1.1 2000/09/15 22:05:47 hubertf Exp $
d34 1
a34 1
lintpkgsrc -r
@


1.1
log
@Bulk build framework
@
text
@d2 1
a2 1
# $Id: pre-build,v 1.8 2000/09/06 00:33:52 feyrer Exp feyrer $
@

