-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike Frysinger wrote:
> On Wednesday 07 June 2006 11:13, Brian Harring wrote:
>>   1) requires modifying the tree, and introduction of eclass for it.
> 
> this is a *huge* con ... developers are lazy, *i'm* lazy ... i certainly do 
> not want to go through every single package i maintain and add 'debug-build' 
> to IUSE or 'inherit some-new-eclass'

Sometimes it takes a little extra work to do things right, but hopefully it 
will pay off in the long run.  A poor design decision made now can haunt us for 
years to come.

> if the large majority of packages are going to be taking advantage of a 
> feature, isnt the logical thing to opt everyone in rather than forcing the 
> majority to opt themselves in ?

It really depends on the pros/cons applying something on a *global* scale, like 
you propose.  A package manager (such as portage) will never be able to make 
debug-build decisions that work well for *every* ebuild.  That's why it's 
better for ebuilds to make those decisions themselves (with the help of 
eclasses).

Sure, it will take some work to make those changes to ebuilds, but it will be 
worth the effort in the long run.  I've attached a script that you can use for 
/etc/portage/bashrc that provides the same functionality as your debug-build 
feature.  You can use it as an interim solution until  USE=debug-build support 
has been added to all of the ebuilds that would benefit from it.

Zac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEhxtN/ejvha5XGaMRAlRuAJ0Q0/p6Tq1k/+N3ejzScYsAe8TgvgCg3Wym
EpgniVng6MItb8uxtJLk5Ac=
=2nT/
-----END PGP SIGNATURE-----
#!/usr/bin/env bash

hasq() {
        [[ " ${*:2} " == *" $1 "* ]]
}

if hasq debug-build ${USE}; then
        [ -z "${DEBUG_CFLAGS}" ] && export DEBUG_CFLAGS="-g -O"
        [ -z "${DEBUG_CXXFLAGS}" ] && export DEBUG_CXXFLAGS="${DEBUG_CFLAGS}"
        for x in CFLAGS CXXFLAGS LDFLAGS; do
                eval "export ${x}=\"\${DEBUG_${x}}\""
        done
        if ! hasq splitdebug ${FEATURES}; then
                export FEATURES="${FEATURES} nostrip"
        fi
fi

Reply via email to