2000-09-16 00:05:46 +02:00
|
|
|
#!/bin/sh
|
2004-01-20 08:39:24 +01:00
|
|
|
# $NetBSD: build,v 1.32 2004/01/20 07:39:24 grant Exp $
|
2001-10-12 21:28:02 +02:00
|
|
|
|
2000-09-16 00:05:46 +02:00
|
|
|
#
|
2001-10-12 21:28:02 +02:00
|
|
|
# Copyright (c) 1999, 2000 Hubert Feyrer <hubertf@netbsd.org>
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
# 3. All advertising materials mentioning features or use of this software
|
|
|
|
# must display the following acknowledgement:
|
|
|
|
# This product includes software developed by Hubert Feyrer for
|
|
|
|
# the NetBSD Project.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
2000-09-16 00:05:46 +02:00
|
|
|
#
|
2001-10-12 21:28:02 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Do builk build
|
2000-09-16 00:05:46 +02:00
|
|
|
#
|
|
|
|
|
2002-08-07 12:56:11 +02:00
|
|
|
opsys=`uname -s`
|
|
|
|
case "$opsys" in
|
|
|
|
NetBSD) BMAKE=make ;;
|
|
|
|
*) BMAKE=bmake ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
export BMAKE
|
|
|
|
|
2001-10-15 19:19:23 +02:00
|
|
|
# Set ressource limits as high as possible
|
|
|
|
ulimit -S -s `ulimit -H -s`
|
|
|
|
ulimit -S -d `ulimit -H -d`
|
|
|
|
|
|
|
|
|
2000-09-16 00:05:46 +02:00
|
|
|
echo Bulk build started: `date`
|
|
|
|
echo ""
|
|
|
|
|
2000-09-29 06:28:50 +02:00
|
|
|
# Pull in ADMIN etc.:
|
2000-09-16 00:05:46 +02:00
|
|
|
if [ -f "$BULK_BUILD_CONF" ]; then
|
|
|
|
. $BULK_BUILD_CONF
|
|
|
|
else
|
|
|
|
conf=`dirname $0`/build.conf
|
|
|
|
if [ -f "$conf" ]; then
|
|
|
|
. $conf
|
|
|
|
else
|
|
|
|
echo "$0: Cannot find config file $conf, aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2002-08-12 16:20:59 +02:00
|
|
|
# set up variables specifically for the bulk build
|
|
|
|
BATCH=1
|
|
|
|
DEPENDS_TARGET=bulk-install
|
|
|
|
export BATCH DEPENDS_TARGET
|
|
|
|
|
2000-09-29 06:28:50 +02:00
|
|
|
if [ "$http_proxy" != "" ]; then
|
|
|
|
echo "Using HTTP proxy $http_proxy"
|
|
|
|
export http_proxy
|
|
|
|
fi
|
|
|
|
if [ "$ftp_proxy" != "" ]; then
|
|
|
|
echo "Using FTP proxy $ftp_proxy"
|
|
|
|
export ftp_proxy
|
|
|
|
fi
|
|
|
|
echo ""
|
|
|
|
|
2000-09-16 00:05:46 +02:00
|
|
|
unset DISPLAY # allow sane failure for gimp, xlispstat
|
|
|
|
|
2002-12-31 13:42:37 +01:00
|
|
|
# Check that the pkg_tools are up to date
|
|
|
|
(cd ${USR_PKGSRC}/pkgtools/pkglint && \
|
|
|
|
${BMAKE} uptodate-pkgtools >/dev/null 2>&1) || \
|
|
|
|
( echo "Updating pkgtools" && \
|
|
|
|
cd ${USR_PKGSRC}/pkgtools/pkg_install && ${BMAKE} clean && \
|
|
|
|
${BMAKE} install && ${BMAKE} clean )
|
|
|
|
|
2000-09-16 00:05:46 +02:00
|
|
|
cd ${USR_PKGSRC}
|
|
|
|
|
|
|
|
if [ "$1" = "restart" ]; then
|
|
|
|
echo Restarting - skipping pre-build script
|
|
|
|
else
|
|
|
|
sh mk/bulk/pre-build # make veryveryclean :)
|
2003-11-20 01:04:12 +01:00
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
echo "Error during bulk-build preparations, aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
2000-09-16 00:05:46 +02:00
|
|
|
fi
|
|
|
|
|
2001-10-20 02:30:22 +02:00
|
|
|
fail=no
|
2001-10-14 22:34:53 +02:00
|
|
|
if [ -d pkgtools/pkglint ]; then
|
|
|
|
cd pkgtools/pkglint
|
2002-08-07 12:56:11 +02:00
|
|
|
DEPENDSTREEFILE=`${BMAKE} show-var VARNAME=DEPENDSTREEFILE` || fail=yes
|
|
|
|
DEPENDSFILE=`${BMAKE} show-var VARNAME=DEPENDSFILE` || fail=yes
|
|
|
|
SUPPORTSFILE=`${BMAKE} show-var VARNAME=SUPPORTSFILE` || fail=yes
|
|
|
|
INDEXFILE=`${BMAKE} show-var VARNAME=INDEXFILE` || fail=yes
|
|
|
|
ORDERFILE=`${BMAKE} show-var VARNAME=ORDERFILE` || fail=yes
|
|
|
|
BROKENFILE=`${BMAKE} show-var VARNAME=BROKENFILE` || fail=yes
|
|
|
|
BUILDLOG=`${BMAKE} show-var VARNAME=BUILDLOG` || fail=yes
|
|
|
|
STARTFILE=`${BMAKE} show-var VARNAME=STARTFILE` || fail=yes
|
2004-01-17 10:38:18 +01:00
|
|
|
AWK=`${BMAKE} show-var VARNAME=AWK` || fail=yes
|
|
|
|
GREP=`${BMAKE} show-var VARNAME=GREP` || fail=yes
|
|
|
|
SED=`${BMAKE} show-var VARNAME=SED` || fail=yes
|
|
|
|
MAIL=`${BMAKE} show-var VARNAME=MAIL` || fail=yes
|
2004-01-20 08:01:18 +01:00
|
|
|
MACHINE_ARCH=`${BMAKE} show-var VARNAME=MACHINE_ARCH` || fail=yes
|
2001-10-14 22:34:53 +02:00
|
|
|
else
|
|
|
|
echo "The pkgtools/pkglint directory does not exist. Please update"
|
|
|
|
echo "your pkgsrc tree in ${USR_PKGSRC}"
|
|
|
|
exit 1
|
|
|
|
fi
|
2001-10-20 02:30:22 +02:00
|
|
|
|
|
|
|
echo "----------------------------------"
|
|
|
|
echo "| Build Temporary Files: |"
|
|
|
|
echo "----------------------------------"
|
|
|
|
echo "DEPENDSTREEFILE = $DEPENDSTREEFILE"
|
|
|
|
echo "DEPENDSFILE = $DEPENDSFILE"
|
|
|
|
echo "SUPPORTSFILE = $SUPPORTSFILE"
|
|
|
|
echo "INDEXFILE = $INDEXFILE"
|
|
|
|
echo "ORDERFILE = $ORDERFILE"
|
|
|
|
echo "BROKENFILE = $BROKENFILE"
|
|
|
|
echo "BUILDLOG = $BUILDLOG"
|
2002-06-29 05:33:34 +02:00
|
|
|
echo "STARTFILE = $STARTFILE"
|
2001-10-20 02:30:22 +02:00
|
|
|
echo "----------------------------------"
|
|
|
|
|
|
|
|
# make sure we have values for these very important
|
|
|
|
# variables
|
|
|
|
if [ $fail = "yes" -o \
|
|
|
|
-z "$DEPENDSTREEFILE" -o \
|
|
|
|
-z "$DEPENDSFILE" -o \
|
|
|
|
-z "$SUPPORTSFILE" -o \
|
|
|
|
-z "$INDEXFILE" -o \
|
|
|
|
-z "$ORDERFILE" -o \
|
|
|
|
-z "$BROKENFILE" -o \
|
2002-08-06 20:14:49 +02:00
|
|
|
-z "$BUILDLOG" -o \
|
2004-01-17 10:38:18 +01:00
|
|
|
-z "$STARTFILE" -o \
|
|
|
|
-z "$AWK" -o \
|
|
|
|
-z "$GREP" -o \
|
|
|
|
-z "$SED" -o \
|
|
|
|
-z "$MAIL" \
|
2001-10-20 02:30:22 +02:00
|
|
|
]; then
|
|
|
|
echo "ERROR: build failed to extract certain key variables."
|
|
|
|
echo " please examine the above list and correct the"
|
|
|
|
echo " problem."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
This commit incorporates several speed improvements which have been tested
over several bulk builds on an alpha:
- At the start of a bulk build, 4 files are created to allow fast lookup of
various dependency tree things. These files are
.index == maps package name (foo-2.3) to directory (bar/foo)
.dependstree == contains the complete pkgsrc dependency tree in a tsort(1)
compatible format.
.depends == contains 1 line per package and lists all the build depends
for the package.
.supports == contains 1 line per package and lists all packages which
depend on this package.
- When a package fails to build, the list of all packages which depend upon
it is read from .supports. Each of those packages is immediately marked
as broken. This prevents us from trying to build those packages which can
have significant overhead if lots of other depends are installed before the
system notices the broken one.
In addition, the post-build postprocessing will now indicate that a package
is 'truely broken' (ie, bad PLIST, failed compilation) vs. a package which
is broken because it depends on a failed package. This assists in determining
where to focus our efforts in fixing broken packages.
- In the old approach, all packages are removed after each one is built. The
purpose was to a) conserve disk space, b) verify that all required dependencies
are in fact listed, and c) prevent conflicts. The problem was that often times
several packages in a row have similar depends. For example we might want to
build several perl packages in a row. In the old approach, we would install perl,
build the pkg, deinstall perl and continue with the next one.
In the new approach, when it is decided that a pkg is out of date and should be
rebuilt, the .depends file is used to obtain a list of pkgs we require. Then
and pkgs which are no longer needed are removed. This helps to minimize the total
number of pkg_add/pkg_delete's in a bulk build.
- Since the order of the build is controlled by the depends tree, all depends for a
given package will have been built by the time the pkg in question needs them.
If any of the depends failed to build, then the pkg which needs the failed one will
have been marked as broken. Given this, the complete depends list for a pkg is
read from .depends and the depends installed via pkg_add rather than relying on
recursive make calls to install the depends.
- while here, fix a few minor bugs
x - don't leave .make log files around when the build succeeds
x - make sure we refer to the correct report file in the email
x - use '.order' for the build order file instead of '.l'
x - use 'grep -c' instead of 'grep | wc -l'
2001-02-01 09:47:29 +01:00
|
|
|
cd ${USR_PKGSRC}
|
|
|
|
|
2001-03-19 12:25:39 +01:00
|
|
|
# get the list of packages which should always be installed during the build
|
|
|
|
cd ${USR_PKGSRC}/pkgtools/pkglint
|
2002-08-07 12:56:11 +02:00
|
|
|
BULK_PREREQ=`${BMAKE} show-var VARNAME=BULK_PREREQ`
|
2001-03-19 12:25:39 +01:00
|
|
|
cd ${USR_PKGSRC}
|
|
|
|
|
|
|
|
# install prerequisite packages. Note: we do this _before_ the depends tree
|
|
|
|
# because some packages like xpkgwedge only become DEPENDS if its installed
|
|
|
|
echo "Installing prerequisite packages specified with BULK_PREREQ..."
|
|
|
|
for pkgdir in $BULK_PREREQ
|
|
|
|
do
|
|
|
|
echo $pkgdir
|
|
|
|
# make sure its installed _and_ packaged
|
2002-08-07 12:56:11 +02:00
|
|
|
cd ${USR_PKGSRC}/$pkgdir && ${BMAKE} bulk-install
|
2001-03-19 12:25:39 +01:00
|
|
|
done
|
|
|
|
|
2001-12-17 03:32:22 +01:00
|
|
|
# Create the bulk cache files
|
2001-03-19 12:25:39 +01:00
|
|
|
cd ${USR_PKGSRC}
|
2000-09-16 00:05:46 +02:00
|
|
|
if [ "$1" != "restart" ]; then
|
2002-08-07 12:56:11 +02:00
|
|
|
cd ${USR_PKGSRC} && ${BMAKE} bulk-cache
|
2002-12-01 06:53:43 +01:00
|
|
|
if [ $? != 0 ]; then
|
|
|
|
echo "$0: Cache creation failed. Aborting build."
|
|
|
|
exit 1
|
|
|
|
fi
|
2000-09-16 00:05:46 +02:00
|
|
|
fi
|
This commit incorporates several speed improvements which have been tested
over several bulk builds on an alpha:
- At the start of a bulk build, 4 files are created to allow fast lookup of
various dependency tree things. These files are
.index == maps package name (foo-2.3) to directory (bar/foo)
.dependstree == contains the complete pkgsrc dependency tree in a tsort(1)
compatible format.
.depends == contains 1 line per package and lists all the build depends
for the package.
.supports == contains 1 line per package and lists all packages which
depend on this package.
- When a package fails to build, the list of all packages which depend upon
it is read from .supports. Each of those packages is immediately marked
as broken. This prevents us from trying to build those packages which can
have significant overhead if lots of other depends are installed before the
system notices the broken one.
In addition, the post-build postprocessing will now indicate that a package
is 'truely broken' (ie, bad PLIST, failed compilation) vs. a package which
is broken because it depends on a failed package. This assists in determining
where to focus our efforts in fixing broken packages.
- In the old approach, all packages are removed after each one is built. The
purpose was to a) conserve disk space, b) verify that all required dependencies
are in fact listed, and c) prevent conflicts. The problem was that often times
several packages in a row have similar depends. For example we might want to
build several perl packages in a row. In the old approach, we would install perl,
build the pkg, deinstall perl and continue with the next one.
In the new approach, when it is decided that a pkg is out of date and should be
rebuilt, the .depends file is used to obtain a list of pkgs we require. Then
and pkgs which are no longer needed are removed. This helps to minimize the total
number of pkg_add/pkg_delete's in a bulk build.
- Since the order of the build is controlled by the depends tree, all depends for a
given package will have been built by the time the pkg in question needs them.
If any of the depends failed to build, then the pkg which needs the failed one will
have been marked as broken. Given this, the complete depends list for a pkg is
read from .depends and the depends installed via pkg_add rather than relying on
recursive make calls to install the depends.
- while here, fix a few minor bugs
x - don't leave .make log files around when the build succeeds
x - make sure we refer to the correct report file in the email
x - use '.order' for the build order file instead of '.l'
x - use 'grep -c' instead of 'grep | wc -l'
2001-02-01 09:47:29 +01:00
|
|
|
|
|
|
|
echo "Starting actual build using the order specified in $ORDERFILE..."
|
2001-03-19 12:25:39 +01:00
|
|
|
cd ${USR_PKGSRC}
|
2001-10-20 02:30:22 +02:00
|
|
|
|
|
|
|
# make sure we have something to grep in in the build loop
|
|
|
|
touch $BUILDLOG
|
|
|
|
|
|
|
|
# Loop over every package in the correct order. Before building
|
|
|
|
# each one, check to see if we've already processed this package
|
|
|
|
# before. This could happen if the build got interrupted and we
|
|
|
|
# started it again with the 'restart' option. This prevents us
|
|
|
|
# from having to do a potentially very large number of make's to
|
|
|
|
# get back to where we let off. After we build each package, add
|
|
|
|
# it to the top level buildlog
|
|
|
|
# (usually '.make' or '.make.${MACHINE}'). As a side benefit, this
|
|
|
|
# can make a progress-meter very simple to add!
|
|
|
|
|
2004-01-17 10:38:18 +01:00
|
|
|
tot=`wc -l $ORDERFILE | ${AWK} '{print $1}'`
|
2001-10-20 02:30:22 +02:00
|
|
|
for pkgdir in `cat $ORDERFILE`
|
|
|
|
do
|
2004-01-17 10:38:18 +01:00
|
|
|
${GREP} -q "^${pkgdir}\$" $BUILDLOG
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
built=`wc -l $BUILDLOG | ${AWK} '{print $1}'`
|
|
|
|
percent=`echo $built $tot | ${AWK} '{printf("%4.1f%%",$1*100/$2);}'`
|
2004-01-20 08:01:18 +01:00
|
|
|
(cd $pkgdir && nice -n 20 ${BMAKE} USE_BULK_CACHE=yes bulk-package </dev/null | ${SED} "s;^;`date '+%m/%d/%y %H:%M:%S'` $built/${tot}=$percent $pkgdir @ ${MACHINE_ARCH}> ;g")
|
2001-10-20 02:30:22 +02:00
|
|
|
echo "$pkgdir" >> $BUILDLOG
|
|
|
|
fi
|
|
|
|
done
|
This commit incorporates several speed improvements which have been tested
over several bulk builds on an alpha:
- At the start of a bulk build, 4 files are created to allow fast lookup of
various dependency tree things. These files are
.index == maps package name (foo-2.3) to directory (bar/foo)
.dependstree == contains the complete pkgsrc dependency tree in a tsort(1)
compatible format.
.depends == contains 1 line per package and lists all the build depends
for the package.
.supports == contains 1 line per package and lists all packages which
depend on this package.
- When a package fails to build, the list of all packages which depend upon
it is read from .supports. Each of those packages is immediately marked
as broken. This prevents us from trying to build those packages which can
have significant overhead if lots of other depends are installed before the
system notices the broken one.
In addition, the post-build postprocessing will now indicate that a package
is 'truely broken' (ie, bad PLIST, failed compilation) vs. a package which
is broken because it depends on a failed package. This assists in determining
where to focus our efforts in fixing broken packages.
- In the old approach, all packages are removed after each one is built. The
purpose was to a) conserve disk space, b) verify that all required dependencies
are in fact listed, and c) prevent conflicts. The problem was that often times
several packages in a row have similar depends. For example we might want to
build several perl packages in a row. In the old approach, we would install perl,
build the pkg, deinstall perl and continue with the next one.
In the new approach, when it is decided that a pkg is out of date and should be
rebuilt, the .depends file is used to obtain a list of pkgs we require. Then
and pkgs which are no longer needed are removed. This helps to minimize the total
number of pkg_add/pkg_delete's in a bulk build.
- Since the order of the build is controlled by the depends tree, all depends for a
given package will have been built by the time the pkg in question needs them.
If any of the depends failed to build, then the pkg which needs the failed one will
have been marked as broken. Given this, the complete depends list for a pkg is
read from .depends and the depends installed via pkg_add rather than relying on
recursive make calls to install the depends.
- while here, fix a few minor bugs
x - don't leave .make log files around when the build succeeds
x - make sure we refer to the correct report file in the email
x - use '.order' for the build order file instead of '.l'
x - use 'grep -c' instead of 'grep | wc -l'
2001-02-01 09:47:29 +01:00
|
|
|
|
|
|
|
echo "Build finished. Removing all installed packages left over from build..."
|
|
|
|
|
2001-03-19 12:25:39 +01:00
|
|
|
for pkgname in `pkg_info -e \*`
|
This commit incorporates several speed improvements which have been tested
over several bulk builds on an alpha:
- At the start of a bulk build, 4 files are created to allow fast lookup of
various dependency tree things. These files are
.index == maps package name (foo-2.3) to directory (bar/foo)
.dependstree == contains the complete pkgsrc dependency tree in a tsort(1)
compatible format.
.depends == contains 1 line per package and lists all the build depends
for the package.
.supports == contains 1 line per package and lists all packages which
depend on this package.
- When a package fails to build, the list of all packages which depend upon
it is read from .supports. Each of those packages is immediately marked
as broken. This prevents us from trying to build those packages which can
have significant overhead if lots of other depends are installed before the
system notices the broken one.
In addition, the post-build postprocessing will now indicate that a package
is 'truely broken' (ie, bad PLIST, failed compilation) vs. a package which
is broken because it depends on a failed package. This assists in determining
where to focus our efforts in fixing broken packages.
- In the old approach, all packages are removed after each one is built. The
purpose was to a) conserve disk space, b) verify that all required dependencies
are in fact listed, and c) prevent conflicts. The problem was that often times
several packages in a row have similar depends. For example we might want to
build several perl packages in a row. In the old approach, we would install perl,
build the pkg, deinstall perl and continue with the next one.
In the new approach, when it is decided that a pkg is out of date and should be
rebuilt, the .depends file is used to obtain a list of pkgs we require. Then
and pkgs which are no longer needed are removed. This helps to minimize the total
number of pkg_add/pkg_delete's in a bulk build.
- Since the order of the build is controlled by the depends tree, all depends for a
given package will have been built by the time the pkg in question needs them.
If any of the depends failed to build, then the pkg which needs the failed one will
have been marked as broken. Given this, the complete depends list for a pkg is
read from .depends and the depends installed via pkg_add rather than relying on
recursive make calls to install the depends.
- while here, fix a few minor bugs
x - don't leave .make log files around when the build succeeds
x - make sure we refer to the correct report file in the email
x - use '.order' for the build order file instead of '.l'
x - use 'grep -c' instead of 'grep | wc -l'
2001-02-01 09:47:29 +01:00
|
|
|
do
|
2004-01-17 10:38:18 +01:00
|
|
|
pkg_info -qe $pkgname
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
pkgdir=`${GREP} " $pkgname " $INDEXFILE | ${AWK} '{print $1}'`
|
2003-05-06 19:40:18 +02:00
|
|
|
case "${BULK_PREREQ}" in
|
|
|
|
*$pkgdir* )
|
2001-03-19 12:25:39 +01:00
|
|
|
echo "Keeping BULK_PREREQ: $pkgname ($pkgdir)" ;
|
2003-05-06 19:40:18 +02:00
|
|
|
;;
|
|
|
|
* )
|
2001-03-19 12:25:39 +01:00
|
|
|
echo pkg_delete -r $pkgname
|
|
|
|
pkg_delete -r $pkgname
|
2004-01-17 10:38:18 +01:00
|
|
|
pkg_info -qe $pkgname
|
|
|
|
if [ $? -eq 0 ]; then
|
2001-03-19 12:25:39 +01:00
|
|
|
echo "$pkgname ($pkgdir) did not deinstall nicely. Forcing the deinstall"
|
2003-05-06 19:40:18 +02:00
|
|
|
pkg_delete -f $pkgname || true
|
|
|
|
fi
|
|
|
|
;;
|
2001-03-19 12:25:39 +01:00
|
|
|
esac
|
This commit incorporates several speed improvements which have been tested
over several bulk builds on an alpha:
- At the start of a bulk build, 4 files are created to allow fast lookup of
various dependency tree things. These files are
.index == maps package name (foo-2.3) to directory (bar/foo)
.dependstree == contains the complete pkgsrc dependency tree in a tsort(1)
compatible format.
.depends == contains 1 line per package and lists all the build depends
for the package.
.supports == contains 1 line per package and lists all packages which
depend on this package.
- When a package fails to build, the list of all packages which depend upon
it is read from .supports. Each of those packages is immediately marked
as broken. This prevents us from trying to build those packages which can
have significant overhead if lots of other depends are installed before the
system notices the broken one.
In addition, the post-build postprocessing will now indicate that a package
is 'truely broken' (ie, bad PLIST, failed compilation) vs. a package which
is broken because it depends on a failed package. This assists in determining
where to focus our efforts in fixing broken packages.
- In the old approach, all packages are removed after each one is built. The
purpose was to a) conserve disk space, b) verify that all required dependencies
are in fact listed, and c) prevent conflicts. The problem was that often times
several packages in a row have similar depends. For example we might want to
build several perl packages in a row. In the old approach, we would install perl,
build the pkg, deinstall perl and continue with the next one.
In the new approach, when it is decided that a pkg is out of date and should be
rebuilt, the .depends file is used to obtain a list of pkgs we require. Then
and pkgs which are no longer needed are removed. This helps to minimize the total
number of pkg_add/pkg_delete's in a bulk build.
- Since the order of the build is controlled by the depends tree, all depends for a
given package will have been built by the time the pkg in question needs them.
If any of the depends failed to build, then the pkg which needs the failed one will
have been marked as broken. Given this, the complete depends list for a pkg is
read from .depends and the depends installed via pkg_add rather than relying on
recursive make calls to install the depends.
- while here, fix a few minor bugs
x - don't leave .make log files around when the build succeeds
x - make sure we refer to the correct report file in the email
x - use '.order' for the build order file instead of '.l'
x - use 'grep -c' instead of 'grep | wc -l'
2001-02-01 09:47:29 +01:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Post processing bulk build results..."
|
|
|
|
|
|
|
|
#rm $DEPENDSTREEFILE $DEPENDSFILE $SUPPORTSFILE $INDEXFILE $ORDERFILE
|
2000-09-16 00:05:46 +02:00
|
|
|
|
|
|
|
# Perl was wiped, reinstall it!
|
2002-08-07 12:56:11 +02:00
|
|
|
( cd lang/perl5 && ${BMAKE} bulk-install )
|
2004-01-20 08:39:24 +01:00
|
|
|
perl mk/bulk/post-build | ${MAIL} -s "pkgsrc/${MACHINE_ARCH} bulk build results `date +%F`" $ADMIN
|
2000-09-16 00:05:46 +02:00
|
|
|
|
|
|
|
# Done!
|
|
|
|
echo ""
|
|
|
|
echo Bulk build ended: `date`
|