Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 146807 - generation-2 eclasses calls die in subshell, thus not dying
Summary: generation-2 eclasses calls die in subshell, thus not dying
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-08 01:07 UTC by Peter Volkov (RETIRED)
Modified: 2006-09-27 14:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed patch (java-utils-2.eclass-subshells.patch,3.97 KB, patch)
2006-09-08 04:50 UTC, Vlastimil Babka (Caster) (RETIRED)
Details | Diff
updated patch (java-utils-2.eclass-subshells.patch,4.06 KB, patch)
2006-09-12 06:59 UTC, Vlastimil Babka (Caster) (RETIRED)
Details | Diff
even more updated patch (java-utils-2.eclass-subshells.patch,4.23 KB, patch)
2006-09-12 15:29 UTC, Vlastimil Babka (Caster) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Volkov (RETIRED) gentoo-dev 2006-09-08 01:07:46 UTC
Hello.

Opening new bug, as requested.

I have not checked other java eclasses but at least inside java-utils-2 eclass  die is calling in subshell, and the result is that the process actually does not die but stay alive. See bug 145679 for example output. See (about die and subshell):
http://devmanual.gentoo.org/ebuild-writing/error-handling/index.html

TIA
Comment 1 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-09-08 04:50:53 UTC
Created attachment 96383 [details, diff]
proposed patch

* failure on depend-java-query for getting the GENTOO_VM is detected and dies earlier, because depend-java-query sux, it has to test result to be empty or == "None"
* java-pkg_javac-args doesn't die, it echoes error as output and returns 1, stuff using it checks return value
* the same with java-pkg_get-javac

and a bonus:
* ejavac() doesn't default to javac anymore, but calls java-pkg_get-javac, call to java-pkg_init-compiler_ is moved from get-javac to ejavac so the einfo isn't echoing in subshell
Comment 2 Josh Nichols (RETIRED) gentoo-dev 2006-09-10 21:53:01 UTC
Patch looks reasonable. Only thing I would change is:

-[[ ${?} ]] || die "java-pkg_javac-args failed"
+[[ ${?} != 0 ]] && die "java-pkg_javac-args failed"

Nothing wrong with it, as in, it works, but IMO, this is a bit clearer.
Comment 3 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-09-12 06:59:05 UTC
Created attachment 96790 [details, diff]
updated patch

Updated to apply to current eclass. The tests nichoj didn't like changed to full if construct to give better error output.
Comment 4 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-09-12 15:29:39 UTC
Created attachment 96838 [details, diff]
even more updated patch

eerrors extended to tell what failed

I'm now using the patch extensively.
Comment 5 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-09-27 06:09:45 UTC
How bout teh commit?
Comment 6 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2006-09-27 14:36:23 UTC
After nichoj's permission, it's in CVS :)