Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 549596 - java-utils-2.eclass patch for correctly writing :SLOT to -SLOT in package.env files
Summary: java-utils-2.eclass patch for correctly writing :SLOT to -SLOT in package.env...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-15 22:50 UTC by William L. Thomson Jr.
Modified: 2018-04-04 14:07 UTC (History)
0 users

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


Attachments
java-utils-2.eclass path to convert : to - for package names written to package.env in DEPEND and other variables (java-utils-2_eclass.patch,1.20 KB, patch)
2015-05-15 22:50 UTC, William L. Thomson Jr.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description William L. Thomson Jr. 2015-05-15 22:50:08 UTC
Created attachment 403350 [details, diff]
java-utils-2.eclass path to convert : to - for package names written to package.env in DEPEND and other variables

Gentoo Java ebuilds use 2 formats for referencing package slots in ebuilds, they use both :SLOT and -SLOT. The latter never should have existed, but does, and the former is the method that is consistent with Gentoo, SLOTS in DEPs, when installing packages via emerge, etc.

While :SLOT is valid for EANT and most all eclass functions that get jars by package names. It does cause a problem when writing the package.env file, as DEPEND and other variables use : as a delimiter. The result is something like

DEPEND="antlr:4:glassfish-connector-api:log4j"

Where antlr:4 ends up as that, so 4 seems like a package name which is not valid. The format for the file wants -SLOT so it can reference the package name on disk in /usr/share/package-SLOT/

I have created a patch which addresses this. It allows both :SLOT and -SLOT to be used in ebuilds as it is now. Till a time when -SLOT can be phased out as that is not the correct portage format for reference a package by slot. You cannot emerge package-slot, you can only emerge package:slot. The result of my patch is as follows. antlr-4 is correct vs antlr:4. Really it should be comma delimited vs : but that is a major change for down the road.

DEPEND="antlr-4:glassfish-connector-api:log4j"

A simple fix of any package names containing : being changed to - fixes this issue. The code that writes the package.env file to disk is already calling tr to replace new line characters with :. I just preceded that with another tr to convert any : to - for DEPEND and other similar variables in package.env. That solves the problem, till -SLOT can be phased out.

Though others want to phase out :SLOT which is incorrect, and likley in any attempt to do such will break things. Things which presently work with :SLOT and were purposely coded that way. Its the -SLOT format that is legacy, wrong, and eventually should go away. But since most all Java ebuilds use that, some want to keep that incorrect format, and try to get rid of :SLOT. Despite the fact that will always be the correct format in the ebuild's DEPEND, not to mention how the packages is referenced on install/uninstall, in world file, etc.