Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#23521 - [namcap] Correctly detect java dependencies

Attached to Project: Arch Linux
Opened by Dan McGee (toofishes) - Wednesday, 30 March 2011, 21:02 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Monday, 25 April 2011, 14:05 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Rémy Oudompheng (remyoudompheng)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Should be pretty straightforward, I think:

$ namcap simian-2.3.31-1-any.pkg.tar.xz
simian E: Dependency detected and not included ('bash')
simian W: Dependency included and not needed ('java-runtime')

$ pacman -Qlp simian-2.3.31-1-any.pkg.tar.xz | grep jar
simian /usr/share/java/simian/simian.jar

So either "*.jar" or "*.class" files in the package invokes a depend (or optdepend?) on 'java-runtime', kinda like how we fake script depends based on the #! lines.

If you want to really get fancy, you can poke at the class files (like we do at ELF) to find the necessary Java version:

.class files always start with HEX "CAFEBABE", followed by minor version, major version.

00000000 ca fe ba be 00 00 00 31 00 07 07 00 05 07 00 06 |.......1........|

So you can see that here in the first part, we have the signature followed by 00 00, and then 00 31 hex->dec 49 == J2SE 5.0.
This task depends upon

Closed by  Rémy Oudompheng (remyoudompheng)
Monday, 25 April 2011, 14:05 GMT
Reason for closing:  Implemented
Additional comments about closing:  To appear in namcap 3.1.0
Comment by Jan de Groot (JGC) - Thursday, 31 March 2011, 08:50 GMT
For java libraries, is it really required to depend on a java runtime? IMHO only applications using the library should depend on a java runtime. Programs like eclipse, vuze, etc. If you're just installing a java library, you want to use it in your environment, not the other way around.
Comment by Rémy Oudompheng (remyoudompheng) - Monday, 25 April 2011, 10:35 GMT
What about depending on java-runtime if the package has something in /usr/bin and java-environment otherwise.
In most cases, however, there is little difference since both are provided by openjdk6 package. And that distinction sounds a little weird, I thought Java had no such thing as "programs" or "libraries", it just has "classes".