1 |
On Wednesday 26 September 2007, Donnie Berkholz wrote: |
2 |
> On 17:53 Wed 26 Sep , Doug Goldstein wrote: |
3 |
> > Mike Frysinger wrote: |
4 |
> > > Donnie Berkholz wrote: |
5 |
> > > also, ebuilds do change over time, so what line # may be correct one |
6 |
> > > day may not be relevant the next ... |
7 |
> > |
8 |
> > True. I will concede this point. I could attempt to argue this is why |
9 |
> > it's important to know the version and revision of the package you are |
10 |
> > emerging. But the counter point is evident, times when the ebuild is |
11 |
> > changed without a bump pose a problem. |
12 |
> > |
13 |
> > Which could bring up a point of would it be useful to see if we can |
14 |
> > print out the actual line that caused the die. Now, I don't know if this |
15 |
> > feasible or something the Portage devs want to do. But again, in the |
16 |
> > effort to streamline this might be something to consider. |
17 |
> |
18 |
> The backtrace code is in ebuild.sh:dump_trace(). If you can find a way |
19 |
> in bash to print the source line, that would be great. I took another |
20 |
> glance through the bash man page and didn't see much from that end. But |
21 |
> since we do have the source file and line number, we could just grab it |
22 |
> with some hack like: |
23 |
> |
24 |
> sed -ne "${lineno}p" ${filename} |
25 |
> |
26 |
> Anyone got something better? |
27 |
|
28 |
that's probably about the best ... the trace was invoked because of the call |
29 |
to `die`, not the previous call and i dont think the stack stuff in bash |
30 |
tracks history, just the current execution tree |
31 |
|
32 |
that sed will probably work about half the time since it'll only work on one |
33 |
liners ... |
34 |
-mike |