Subject: Re: pre-build.local
To: Roland Illig <rillig@NetBSD.org>
From: Krister Walfridsson <cato@df.lth.se>
List: pkgsrc-bulk
Date: 11/20/2005 23:00:48
On Sun, 20 Nov 2005, Roland Illig wrote:

> the pkgsrc guide says that this program is "executed as a &man.sh.1; script". 
> This is wrong.
>
> It is actually sourced in and can overwrite any variables or shell settings 
> of the "build" script. Is that intended at all? To have a more controlled 
> environment for the "build" script I would like to implement what the 
> documentation says, that is to call
>
>    /usr/bin/env BROKENF="${BROKENF}" /bin/sh mk/bulk/pre-build.local

No objections from me.

But I think there are more issues with the pre-build.local file...
The example from the pkgsrc guide in how to use it is for "pre-breaking"
a package by writing a $BROKENF:

   # echo "I do not have enough disk space to build this pig." \
       > pkgsrc/misc/openoffice/$BROKENF

(btw. note that the example is incorrect -- the path should be
"misc/openoffice/$BROKENF").  This works in the sense that the
package will not be built, but it will not be mentioned in the
bulk summary, and its dependencies will be marked as broken with
a message similar to "Pkg foo depends on pkg bar that seems
to have troubles" (which is confusing, since it looks like the
package "bar" was built successfully).

What I'd like to see is a mechanism where you can list packages
that are broken/unavailable, and cause the summary to look like
the package had been marked broken/unavailable at build time.
I.e. something similar to:

    BROKEN.sbcl+="Goes into infinite loop at build time."
    PKG_SKIP_REASON.openoffice+="I do not have enough disk space to build."

This could also be used to handle e.g. the code

   if [ x"$BMAKE" = x"bmake" ]; then
           for pkg in archivers/pax devel/bmake devel/mk-files net/tnftp \
               security/kth-krb4 textproc/nbsed; do
                   echo "Don't blow away bootstrap-pkgsrc stuff!" > \
                   ${pkg}/${BROKENF}
           done
   fi

that currently is done in mk/bulk/pre-build.

    /Krister