2001-05-09 04:54:38 +02:00
|
|
|
# $NetBSD: bsd.bulk-pkg.mk,v 1.27 2001/05/09 02:54:38 hubertf Exp $
|
2000-07-28 02:46:17 +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.
|
|
|
|
#
|
|
|
|
|
|
|
|
##
|
|
|
|
## For this to work, put
|
|
|
|
## DEPENDS_TARGET= bulk-install
|
|
|
|
## BATCH= yes
|
|
|
|
## into your /etc/mk.conf, then cd /usr/pkgsrc; make bulk-package
|
|
|
|
##
|
|
|
|
## bulk-install will only compile pkgs if necessary, and install binary
|
|
|
|
## pkgs if possible/available.
|
|
|
|
## bulk-package will build binary packages, and remove them (together with
|
|
|
|
## any depending packages) immediately after that, leaving only the
|
|
|
|
## binary package back. Broken packages are marked (``.broken'').
|
|
|
|
##
|
|
|
|
|
|
|
|
LS?= ls
|
|
|
|
WC?= wc
|
|
|
|
|
2001-02-14 00:02:23 +01:00
|
|
|
# This variable is set to 'yes' by the pkgsrc/mk/bulk/build script. It enables
|
|
|
|
# the use of several cache files (DEPENDSTREEFILE, DEPENDSFILE, SUPPORTSFILE,
|
|
|
|
# and INDEXFILE) for speeding up the processing of dependencies. If we're not
|
|
|
|
# actively in the middle of a bulk build, however, we don't know that these files
|
|
|
|
# exist or are up to date and they take quite a while to rebuild. So unless
|
|
|
|
# they're known to exist and be up to date, don't use them.
|
|
|
|
USE_BULK_CACHE?= no
|
|
|
|
|
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
|
|
|
# Shall we remove any packages which are installed, but not required
|
|
|
|
# to build this package
|
|
|
|
PRECLEAN?= yes
|
2000-07-28 02:46:17 +02:00
|
|
|
|
|
|
|
.ifdef OBJMACHINE
|
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
|
|
|
# This file exists to mark a package as broken
|
2000-07-28 02:46:17 +02:00
|
|
|
BROKENFILE?= .broken.${MACHINE}
|
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
|
|
|
|
|
|
|
# This file is where the log of the build goes
|
2000-07-28 02:46:17 +02:00
|
|
|
BUILDLOG?= .make.${MACHINE}
|
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
|
|
|
|
|
|
|
# This is a top level file which lists the entire pkgsrc depends tree in the format:
|
|
|
|
# foo/bar devel/libfoo
|
|
|
|
# meaning 'foo/bar' is requied to build 'devel/libfoo'
|
|
|
|
# this is in the format needed by tsort(1)
|
|
|
|
DEPENDSTREEFILE?= ${PKGSRCDIR}/.dependstree.${MACHINE}
|
|
|
|
|
|
|
|
# This is a top level file which lists the entire pkgsrc depends tree in the format:
|
|
|
|
# foo/bar depends on: devel/libfoo devel/libbar devel/baz .....
|
|
|
|
# ie, to build foo/bar we need devel/libfoo devel/libbar devel/baz ... installed
|
|
|
|
DEPENDSFILE?= ${PKGSRCDIR}/.depends.${MACHINE}
|
|
|
|
|
|
|
|
# This is a top level file which lists the entire pkgsrc depends tree in the format:
|
|
|
|
# devel/libfoo is depended upon by: foo/bar graphics/gtkfoo ...
|
|
|
|
# ie, to build foo/bar we need devel/libfoo to be installed.
|
|
|
|
# to build graphics/gtkfoo we need devel/libfoo to be installed
|
|
|
|
SUPPORTSFILE?= ${PKGSRCDIR}/.supports.${MACHINE}
|
|
|
|
|
|
|
|
# This is a top level file which cross-references each package name and pkg directory
|
|
|
|
# in the format:
|
|
|
|
# devel/libfoo libfoo-1.3
|
|
|
|
INDEXFILE?= ${PKGSRCDIR}/.index.${MACHINE}
|
|
|
|
|
|
|
|
# file containing a list of all the packages in the correct order for a bulk build.
|
|
|
|
# the correct order is one where packages that are required by others are built
|
|
|
|
# before the packages which require them.
|
|
|
|
ORDERFILE?= ${PKGSRCDIR}/.order.${MACHINE}
|
|
|
|
|
2000-07-28 02:46:17 +02:00
|
|
|
.else
|
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
|
|
|
BROKENFILE?= .broken
|
|
|
|
BUILDLOG?= .make
|
|
|
|
DEPENDSTREEFILE?= ${PKGSRCDIR}/.dependstree
|
|
|
|
DEPENDSFILE?= ${PKGSRCDIR}/.depends
|
|
|
|
SUPPORTSFILE?= ${PKGSRCDIR}/.supports
|
|
|
|
INDEXFILE?= ${PKGSRCDIR}/.index
|
|
|
|
ORDERFILE?= ${PKGSRCDIR}/.order
|
2000-07-28 02:46:17 +02:00
|
|
|
.endif
|
|
|
|
|
2001-03-19 12:25:39 +01:00
|
|
|
# a list of pkgs which we should _never_ delete during a build. The primary use is for digest
|
|
|
|
# and also for xpkgwedge. Add pkgtools/xpkgwedge in /etc/mk.conf to do an xpkgwedged bulk build.
|
|
|
|
BULK_PREREQ+= pkgtools/digest
|
2000-07-28 02:46:17 +02:00
|
|
|
|
|
|
|
# check if the $REF file is uptodate, i.e. is newer than any of
|
|
|
|
# the pkg files; prints "1" if upto date, "0" if not.
|
|
|
|
bulk-check-uptodate:
|
|
|
|
@uptodate=1 ; \
|
|
|
|
if [ -f "${REF}" ]; then \
|
|
|
|
${SHCOMMENT} "Check files of this package" ; \
|
2001-01-28 22:20:48 +01:00
|
|
|
newfiles="`find . -type f -newer "${REF}" -print | ${EGREP} -v -e ./work -e pkg/COMMENT -e pkg/DESCR -e README.html -e CVS -e '^\./\.' || true`" ; \
|
|
|
|
nnewfiles="`find . -type f -newer "${REF}" -print | ${EGREP} -v -e ./work -e pkg/COMMENT -e pkg/DESCR -e README.html -e CVS -e '^\./\.' | ${WC} -l`" ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
if [ "$$nnewfiles" -gt 0 ]; then \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} >&2 "BULK> Package ${PKGNAME} ($$newfiles) modified since last 'make package' re-packaging..." ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
uptodate=0 ; \
|
|
|
|
else \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} >&2 "BULK> ${REF} is up to date." ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
fi ; \
|
|
|
|
else \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} >&2 "BULK> Package ${PKGNAME} not built yet, packaging..." ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
uptodate=0 ; \
|
|
|
|
fi ; \
|
|
|
|
if [ "$$uptodate" = "1" ]; then \
|
|
|
|
${SHCOMMENT} "Check required binary packages" ; \
|
|
|
|
deps=`${PKG_INFO} -qf ${REF} \
|
|
|
|
| ${GREP} ^@pkgdep \
|
|
|
|
| ${SED} 's,@pkgdep.,,g'`; \
|
|
|
|
for dep in $$deps ; do \
|
|
|
|
${SHCOMMENT} "check against the binary pkg that pkg_add would pick, too:" ; \
|
|
|
|
${SHCOMMENT} "(Only one should be returned here, really...)" ; \
|
2000-08-25 14:43:28 +02:00
|
|
|
pkg=`${PKG_ADMIN} lsbest "${PACKAGES}/All/$$dep"` ; \
|
|
|
|
if [ -z $$pkg ]; then \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} >&2 "BULK> Required binary package $$dep does not exist, rebuilding... " ; \
|
2000-08-25 14:43:28 +02:00
|
|
|
uptodate=0 ; \
|
|
|
|
elif [ "$$pkg" -nt "${REF}" ]; then \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} >&2 "BULK> Required binary package $$dep (`basename $$pkg`) is newer, rebuilding... " ; \
|
2000-08-25 14:43:28 +02:00
|
|
|
uptodate=0 ; \
|
|
|
|
else \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} >&2 "BULK> Required binary package $$dep (`basename $$pkg`) is usable. " ; \
|
2000-08-25 14:43:28 +02:00
|
|
|
fi ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
done ; \
|
|
|
|
fi ; \
|
|
|
|
${ECHO_MSG} $$uptodate
|
|
|
|
|
|
|
|
# rebuild binpkg if any of the pkg files is newer than the binary archive
|
|
|
|
# set DO to ":" to not actually do anything (debugging, ...)
|
|
|
|
bulk-package:
|
2000-09-02 15:53:06 +02:00
|
|
|
@if [ -f ${BROKENFILE} ]; then \
|
|
|
|
${ECHO_MSG} "BULK> *** Package ${PKGNAME} seems broken and needs attention:" ; \
|
|
|
|
${LS} -la ${BROKENFILE}; \
|
|
|
|
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
|
|
|
if [ "${PRECLEAN}" = "yes" ]; then \
|
2000-07-28 02:46:17 +02:00
|
|
|
${ECHO_MSG} '' ; \
|
|
|
|
${ECHO_MSG} '' ; \
|
|
|
|
${ECHO_MSG} '###' ; \
|
2001-05-09 04:54:38 +02:00
|
|
|
${ECHO_MSG} '###' `date`: ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
${ECHO_MSG} '### ${MAKE} ${.TARGET} for ${PKGNAME}' ; \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} '### Current pkg count: ' `${LS} -l ${PKG_DBDIR} | ${GREP} ^d | ${WC} -l` installed packages: `${LS} ${PKG_DBDIR} | ${GREP} -v pkgdb.byfile.db`; \
|
2000-07-28 02:46:17 +02:00
|
|
|
${ECHO_MSG} '###' ; \
|
2000-09-02 15:53:06 +02:00
|
|
|
fi \
|
|
|
|
) 2>&1 | tee -a ${BUILDLOG}
|
2000-07-28 02:46:17 +02:00
|
|
|
@uptodate=`${MAKE} ${MAKEFLAGS} bulk-check-uptodate REF=${PKGFILE}` ; \
|
|
|
|
if ${PKG_INFO} -qe "${PKGNAME:C/-[^-]*$/-[0-9]*/}" ; then \
|
|
|
|
installed=1; \
|
|
|
|
else \
|
|
|
|
installed=0; \
|
|
|
|
fi ; \
|
|
|
|
if [ $$uptodate = 1 ]; then \
|
2000-09-02 15:53:06 +02:00
|
|
|
( if [ $$installed = 1 ]; then \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} "BULK> Package ${PKGNAME} is upto-date, and still installed" ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
else \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} "BULK> Nothing to be done." ; \
|
2000-09-02 15:53:06 +02:00
|
|
|
fi \
|
|
|
|
) 2>&1 | tee -a ${BUILDLOG}; \
|
2000-07-28 02:46:17 +02:00
|
|
|
else \
|
2000-09-02 15:53:06 +02:00
|
|
|
( if [ $$installed = 1 ]; then \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} "BULK> Removing outdated (installed) package ${PKGNAME} first." ; \
|
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_MSG} ${MAKE} deinstall ; \
|
|
|
|
${DO} ${MAKE} deinstall ; \
|
2000-07-28 02:46:17 +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
|
|
|
if [ -f ${PKGFILE} ]; then \
|
2000-08-24 02:52:23 +02:00
|
|
|
${ECHO_MSG} "BULK> Removing old binary package..." ; \
|
|
|
|
${ECHO_MSG} ${RM} -f ${PKGFILE} ; \
|
|
|
|
${DO} ${RM} -f ${PKGFILE} ; \
|
2001-02-15 21:13:28 +01:00
|
|
|
for cat in ${CATEGORIES} ;\
|
|
|
|
do \
|
|
|
|
${ECHO_MSG} ${RM} -f ${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}; \
|
|
|
|
${DO} ${RM} -f ${PACKAGES}/$$cat/${PKGNAME}${PKG_SUFX}; \
|
|
|
|
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
|
|
|
fi; \
|
2001-02-14 00:02:23 +01:00
|
|
|
${ECHO_MSG} "BULK> Full rebuild in progress..." ; \
|
|
|
|
${ECHO_MSG} "BULK> Cleaning package and its depends" ;\
|
|
|
|
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
|
2001-05-03 23:19:55 +02:00
|
|
|
for pkgdir in ${PKGPATH} `${GREP} "^${PKGPATH} " ${DEPENDSFILE} | ${SED} -e 's;^.*:;;g'`; do \
|
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} (cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} clean) ; \
|
|
|
|
done ;\
|
2001-02-14 00:02:23 +01:00
|
|
|
else \
|
|
|
|
${ECHO_MSG} ${MAKE} clean CLEANDEPENDS=YES;\
|
|
|
|
${DO} ${MAKE} clean CLEANDEPENDS=YES;\
|
|
|
|
fi; \
|
2001-05-03 23:19:55 +02:00
|
|
|
if [ "${PRECLEAN}" = "yes" ]; then \
|
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_MSG} "BULK> Removing installed packages which are not needed to build ${PKGNAME}" ; \
|
2001-03-31 02:03:03 +02: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 \
|
2001-05-03 23:19:55 +02:00
|
|
|
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
|
|
|
|
pkgdir=`${GREP} " $$pkgname " ${INDEXFILE} | ${AWK} '{print $$1}'` ;\
|
|
|
|
if ${PKG_INFO} -qe $$pkgname ; then \
|
|
|
|
${SHCOMMENT} "Remove only unneeded pkgs" ; \
|
|
|
|
if ! ${EGREP} -q "^${PKGPATH}.* $$pkgdir( |$$)" ${DEPENDSFILE} ; then \
|
|
|
|
case "${BULK_PREREQ}" in \
|
|
|
|
*$$pkgdir* ) \
|
|
|
|
${ECHO_MSG} "BULK> Keeping BULK_PREREQ: $$pkgname ($$pkgdir)" ;\
|
|
|
|
;; \
|
|
|
|
* ) \
|
|
|
|
${ECHO_MSG} ${PKG_DELETE} -r $$pkgname ; \
|
|
|
|
${DO} ${PKG_DELETE} -r $$pkgname || true ; \
|
|
|
|
if ${PKG_INFO} -qe $$pkgname ; then \
|
|
|
|
${DO} ${PKG_DELETE} -f $$pkgname || true ; \
|
|
|
|
fi ;\
|
|
|
|
;; \
|
|
|
|
esac ; \
|
|
|
|
else \
|
|
|
|
${ECHO_MSG} "BULK> ${PKGNAME} requires installed package $$pkgname ($$pkgdir) to build." ;\
|
|
|
|
fi ;\
|
|
|
|
fi ;\
|
|
|
|
else \
|
|
|
|
${SHCOMMENT} "Remove all pkgs" ; \
|
|
|
|
${ECHO_MSG} ${PKG_DELETE} -r $$pkgname ; \
|
|
|
|
${DO} ${PKG_DELETE} -r $$pkgname || true ; \
|
|
|
|
if ${PKG_INFO} -qe $$pkgname ; then \
|
|
|
|
${DO} ${PKG_DELETE} -f $$pkgname || true ; \
|
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 ;\
|
|
|
|
fi ;\
|
|
|
|
done ; \
|
|
|
|
fi ;\
|
2001-02-14 00:02:23 +01:00
|
|
|
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
|
2001-05-09 04:54:38 +02:00
|
|
|
${SHCOMMENT} "Install required depends via binarypkgs XXX" ; \
|
2001-02-14 00:02:23 +01:00
|
|
|
${ECHO_MSG} "BULK> Installing packages which are required to build ${PKGNAME}." ;\
|
2001-05-03 23:19:55 +02:00
|
|
|
for pkgdir in `${GREP} "^${PKGPATH} " ${DEPENDSFILE} | ${SED} -e 's;^.*:;;g'` ${BULK_PREREQ} ; do \
|
2001-02-14 00:02:23 +01:00
|
|
|
pkgname=`${GREP} "^$$pkgdir " ${INDEXFILE} | ${AWK} '{print $$2}'` ; \
|
|
|
|
pkgfile=${PACKAGES}/All/$${pkgname}.tgz ;\
|
2001-05-03 23:19:55 +02:00
|
|
|
if ! ${PKG_INFO} -qe $$pkgname ; then \
|
2001-05-02 15:51:43 +02:00
|
|
|
if [ -f $$pkgfile ]; then \
|
|
|
|
${ECHO_MSG} "BULK> ${PKG_ADD} $$pkgfile"; \
|
2001-05-09 04:39:31 +02:00
|
|
|
${DO} ${PKG_ADD} $$pkgfile || ${ECHO_MSG} "warning: could not add $$pkgfile." ; \
|
2001-05-02 15:51:43 +02:00
|
|
|
else \
|
|
|
|
${ECHO_MSG} "BULK> warning: $$pkgfile does not exist. It will be rebuilt." ;\
|
|
|
|
fi ;\
|
2001-02-14 00:02:23 +01:00
|
|
|
else \
|
|
|
|
${ECHO_MSG} "BULK> Required package $$pkgname ($$pkgdir) is already installed" ; \
|
|
|
|
fi ;\
|
|
|
|
done ;\
|
|
|
|
fi ;\
|
2000-09-02 15:53:06 +02:00
|
|
|
${ECHO_MSG} ${MAKE} package '(${PKGNAME})' 2>&1 ; \
|
|
|
|
${DO} ( ${MAKE} package 2>&1 ); \
|
|
|
|
) 2>&1 | tee -a ${BUILDLOG} ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
if [ -f ${PKGFILE} ]; then \
|
2000-09-02 16:05:36 +02:00
|
|
|
${RM} ${BUILDLOG} ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
else \
|
|
|
|
${MV} ${BUILDLOG} ${BROKENFILE} ; \
|
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
|
|
|
( \
|
2000-07-28 02:46:17 +02:00
|
|
|
${ECHO_MSG} "BULK> ${PKGNAME} was marked as broken:" ; \
|
|
|
|
${LS} -la ${BROKENFILE} ; \
|
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_MSG} ${MAKE} deinstall ; \
|
|
|
|
${DO} ${MAKE} deinstall ; \
|
2001-02-08 20:17:38 +01:00
|
|
|
nbrokenby=0;\
|
2001-02-14 00:02:23 +01:00
|
|
|
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
|
|
|
|
${ECHO_MSG} "BULK> Marking all packages which depend upon ${PKGNAME} as broken:"; \
|
2001-05-03 23:19:55 +02:00
|
|
|
for pkgdir in `${GREP} "^${PKGPATH} " ${SUPPORTSFILE} | ${SED} -e 's;^.*:;;g'`; do \
|
2001-02-14 00:02:23 +01:00
|
|
|
pkgname=`${GREP} "^$$pkgdir " ${INDEXFILE} | ${AWK} '{print $$2}'` ;\
|
|
|
|
${ECHO_MSG} "BULK> marking package that requires ${PKGNAME} as broken: $$pkgname ($$pkgdir)";\
|
|
|
|
pkgerr="-1"; \
|
|
|
|
pkgignore=`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=IGNORE)`; \
|
|
|
|
if [ ! -z "$$pkgignore" -a ! -f ${PKGSRCDIR}/$$pkgdir/${BROKENFILE} ]; then \
|
|
|
|
${ECHO_MSG} "BULK> $$pkgname ($$pkgdir) may not be packaged because:" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
|
|
|
|
${ECHO_MSG} "BULK> $$pkgignore" >> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
|
|
|
|
if [ -z "`(cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} show-var VARNAME=BROKEN)`" ]; then \
|
|
|
|
pkgerr="0"; \
|
|
|
|
else \
|
|
|
|
pkgerr="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
|
|
|
fi; \
|
2001-05-03 23:19:55 +02:00
|
|
|
${ECHO_MSG} "BULK> $$pkgname ($$pkgdir) is broken because it depends upon ${PKGNAME} (${PKGPATH}) which is broken." \
|
2001-02-14 00:02:23 +01:00
|
|
|
>> ${PKGSRCDIR}/$$pkgdir/${BROKENFILE};\
|
|
|
|
nbrokenby=`expr $$nbrokenby + 1`;\
|
2001-03-19 12:25:39 +01:00
|
|
|
if ! ${GREP} -q " $$pkgdir/${BROKENFILE}" ${PKGSRCDIR}/${BROKENFILE} ; then \
|
2001-02-14 00:02:23 +01:00
|
|
|
${ECHO} " $$pkgerr $$pkgdir/${BROKENFILE} 0 " >> ${PKGSRCDIR}/${BROKENFILE} ;\
|
|
|
|
fi ;\
|
|
|
|
done ;\
|
|
|
|
fi ;\
|
2001-02-08 20:17:38 +01:00
|
|
|
nerrors=`${GREP} -c '^\*\*\* Error code' ${BROKENFILE} || true`; \
|
|
|
|
${ECHO_MSG} " $$nerrors ${PKGPATH}/${BROKENFILE} $$nbrokenby " >> ${PKGSRCDIR}/${BROKENFILE} \
|
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
|
|
|
) 2>&1 | tee -a ${BROKENFILE}; \
|
2000-07-28 02:46:17 +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_MSG} "BULK> Cleaning packages and its depends" ;\
|
2001-02-14 00:02:23 +01:00
|
|
|
if [ "${USE_BULK_CACHE}" = "yes" ]; then \
|
2001-05-03 23:19:55 +02:00
|
|
|
for pkgdir in ${PKGPATH} `${GREP} "^${PKGPATH} " ${DEPENDSFILE} | ${SED} -e 's;^.*:;;g'`; do \
|
2001-02-14 00:02:23 +01:00
|
|
|
${DO} (cd ${PKGSRCDIR}/$$pkgdir && ${MAKE} clean) ; \
|
|
|
|
done ;\
|
|
|
|
else \
|
|
|
|
${ECHO_MSG} ${MAKE} clean CLEANDEPENDS=YES;\
|
|
|
|
${DO} ${MAKE} clean CLEANDEPENDS=YES;\
|
|
|
|
fi ;\
|
2000-07-28 02:46:17 +02:00
|
|
|
fi
|
|
|
|
@if [ ! -f ${PKGFILE} ]; then \
|
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_MSG} "BULK>" Build for ${PKGNAME} was not successful, aborting. | tee -a ${BROKENFILE} ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
false; \
|
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
|
|
|
else \
|
|
|
|
${RM} -f ${BUILDLOG} ;\
|
2000-07-28 02:46:17 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Install pkg - if possible from binary pkg (i.e. available & upto date)
|
|
|
|
# else revert to the old recompiling.
|
|
|
|
# Don't rely upon pkg_add to snarf in depending pkgs as they may have
|
|
|
|
# been modified and need rebuilding.
|
|
|
|
bulk-install:
|
|
|
|
@if [ `${MAKE} bulk-check-uptodate REF=${PKGFILE}` = 1 ]; then \
|
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
|
|
|
if ! ${PKG_INFO} -qe ${PKGNAME} ; then \
|
2000-08-01 04:56:43 +02:00
|
|
|
${DO} ${MAKE} install-depends ; \
|
2001-01-28 22:20:48 +01:00
|
|
|
${ECHO_MSG} "BULK> " ${PKG_ADD} ${PKGFILE} ; \
|
2000-07-28 02:46:17 +02:00
|
|
|
${DO} ${PKG_ADD} ${PKGFILE} ; \
|
|
|
|
fi ; \
|
|
|
|
else \
|
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_MSG} ${MAKE} bulk-package PRECLEAN=no; \
|
|
|
|
${DO} ${MAKE} bulk-package PRECLEAN=no; \
|
2000-07-28 02:46:17 +02:00
|
|
|
fi
|