Re: [gentoo-dev] Re: [gentoo-portage-dev] allow extra info to be echod on die

2005-10-05 Thread Brian Harring
On Wed, Oct 05, 2005 at 03:04:23PM -0400, Aron Griffis wrote:
> Brian Harring wrote:  [Wed Oct 05 2005, 02:47:09PM EDT]
> >>  diefunc() {
> >> local funcname="$1" lineno="$2" exitcode="$3"
> >> shift 3
> >> @@ -289,6 +291,7 @@
> >> echo "!!! ${*:-(no error message)}" >&2
> >> echo "!!! If you need support, post the topmost build error, NOT 
> >this status message." >&2
> >> echo >&2
> >> +  for x in $EBUILD_DEATH_HOOKS; do
> >> +  ${x} "$1" "$2" "$3"
> >> +   done
> >> exit 1
> >>  }
> 
> Is this exactly what went in?  It looks like you're trying to use
> positional params that were shifted earlier.

No, the hooks are called with "$@" actually, plus some checks to 
ensure that
A) the output goes to stderr, which is the norm for die
B) the hooks aren't engaged during depends phase.

if people are after the func/line/exit code being handed to the hook, 
it can be changed, the intention was for this to allow dumping extra 
debug info.
~harring


pgpP7mr8CIrft.pgp
Description: PGP signature


Re: [gentoo-dev] Re: [gentoo-portage-dev] allow extra info to be echod on die

2005-10-05 Thread Aron Griffis

Brian Harring wrote:[Wed Oct 05 2005, 02:47:09PM EDT]

>  diefunc() {
> local funcname="$1" lineno="$2" exitcode="$3"
> shift 3
> @@ -289,6 +291,7 @@
> echo "!!! ${*:-(no error message)}" >&2
> echo "!!! If you need support, post the topmost build error, NOT this status 
message." >&2
> echo >&2
> +  for x in $EBUILD_DEATH_HOOKS; do
> +  ${x} "$1" "$2" "$3"
> +   done
> exit 1
>  }


Is this exactly what went in?  It looks like you're trying to use
positional params that were shifted earlier.

Regards,
Aron

--
Aron Griffis
Gentoo Linux Developer



pgpUEDxFafRfx.pgp
Description: PGP signature


Re: [gentoo-dev] Re: [gentoo-portage-dev] allow extra info to be echod on die

2005-10-05 Thread Daniel Ostrow
On Wed, 2005-10-05 at 13:47 -0500, Brian Harring wrote:
> 2.0.51_rc4

And by 2.0.51_rc4 he really meant 2.0.53_rc4. :)

-- 
Daniel Ostrow
Gentoo Foundation Board of Trustees
Gentoo/{PPC,PPC64,DevRel}
[EMAIL PROTECTED]

-- 
gentoo-dev@gentoo.org mailing list



[gentoo-dev] Re: [gentoo-portage-dev] allow extra info to be echod on die

2005-10-05 Thread Brian Harring
Just an addendum to this... it went in, will be available in 
2.0.51_rc4 and up.

If you want all registered death funcs to kick in,

EBUILD_DEATH_HOOKS="$EBUILD_DEATH_HOOKS the_name_of_your_func"

or if you want just your func to run

EBUILD_DEATH_HOOKS="the_name_of_your_func"

CC'ing gentoo-dev, since I'd expect some devs would be interested in 
it.
~harring

On Wed, Oct 05, 2005 at 11:48:01AM -0500, Brian Harring wrote:
> On Wed, Oct 05, 2005 at 04:33:17PM +, Thomas Matthijs wrote:
> > Hi,
> > 
> > I would really like a way to echo more information when a die happens so
> > the users can paste it in their bug report
> > 
> > Only needs a very simple change to ebuild.sh:
> > 
> EBUILD_DEATH_HOOKS=''
> 
>  diefunc() {
> local funcname="$1" lineno="$2" exitcode="$3"
> shift 3
> @@ -289,6 +291,7 @@
> echo "!!! ${*:-(no error message)}" >&2
> echo "!!! If you need support, post the topmost build error, NOT this 
> status message." >&2
> echo >&2
> + for x in $EBUILD_DEATH_HOOKS; do
> + ${x} "$1" "$2" "$3"
> +   done
> exit 1
>  }
> ^^^ something like that I think is a bit better; passing the diefunc 
> args to the hooks also.
> ~harring




pgpYKG8kcCPsA.pgp
Description: PGP signature