Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] lights on internals
Date: Mon, 31 Oct 2011 03:56:22
Message-Id: 20051003064252.GE27872@nightcrawler
In Reply to: [gentoo-dev] lights on internals by Francesco R
1 On Sun, Oct 02, 2005 at 11:07:13PM +0200, Francesco R wrote:
2 > The ready to cut ebuild at the bottom print it's environment (variable
3 > and functions) to a bunch of files into /var/tmp/fakebuild/.
4 > May be useful for who want to have a look at "what" and "when" is
5 > avaible during the various emerge phases (but not limited to).
6 > print_env() {
7 > local fakebuild_output_dir="/var/tmp/fakebuild"
8 > mkdir -p "${fakebuild_output_dir}" || die
9 >
10 > [[ -z "${fakebuild_progr}" ]] && fakebuild_progr=100
11 > fakebuild_progr=$(( $fakebuild_progr +1 ))
12 > export fakebuild_progr
13 >
14 > local fakebuild_ext="${1}.${fakebuild_progr}"
15 >
16 > # not sorting, break multiline vars
17 > einfo "${fakebuild_output_dir}/env_${fakebuild_ext}"
18 > env \
19 > &> "${fakebuild_output_dir}/env_${fakebuild_ext}"
20 >
21 > # Remove egrep and sort to see the source of every fx
22 > einfo "${fakebuild_output_dir}/fxlist_${fakebuild_ext}"
23 > typeset \
24 > | egrep '^\b.* \(\)' \
25 > | sort \
26 > &> "${fakebuild_output_dir}/fxlist_${fakebuild_ext}"
27 > }
28
29 This won't work as you expect. Env is a binary, it only gets
30 the exported env.
31
32 Elaborate on the "what and when" bit also, since the env that's dumped
33 to ebuild.sh varies depending on a lot of things.
34 ~harring

Replies

Subject Author
Re: [gentoo-dev] lights on internals Francesco R <vivo@g.o>