Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70608 - java_pkg-dojar mishandles symlinks
Summary: java_pkg-dojar mishandles symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 127816
Blocks:
  Show dependency tree
 
Reported: 2004-11-09 13:39 UTC by Andrew Cowie
Modified: 2006-06-30 19:48 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Cowie 2004-11-09 13:39:58 UTC
If the upstream package creates symlinks to its own jars, and then java_pkg-dojar is called over it, then the symlinks are copied as real files not as symlinks.

ie if you start with

56432  blah-0.0.1.jar
   17  blah.jar -> blah-0.0.1.jar

dojar's copy results in 

56432  blah-0.0.1.jar
56432  blah.jar

You probably want the -d copion to `cp`.

Also, when a symlink was present, the generated package.env file had duplicate entries, which was WEIRD.

AfC
Comment 1 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2005-01-31 16:23:53 UTC
This is definitely a problem, but depending on how the symlink looks like, a cp -d may not solve the problem correctly:

1) if the symlink has an absolute path, cp -d will result in a symlink into
   /var/tmp/portage, which is not what we want
2) if the symlink is merely a convenience of the build system, and the real
   .jar is located elsewhere, we cannot copy the symlink, but its contents
3) what if I call dojar twice, once with the real file and then with its symlink?

AFAICT, the only reasonable compromise between adding all kinds of stored state logic to dojar and just doing cp -d, is checking the list of arguments, and
only if some are symlinks to others, copy them as such. 
Comment 2 Thomas Matthijs (RETIRED) gentoo-dev 2005-09-10 11:25:19 UTC
the dojar from
http://gentooexperimental.org/svn/java/axxo-overlay/eclass/java-utils.eclass
should do it correctly (i think)
Comment 3 Josh Nichols (RETIRED) gentoo-dev 2006-06-30 19:48:15 UTC
Fixed with new Java system.
Comment 4 Josh Nichols (RETIRED) gentoo-dev 2006-06-30 19:48:36 UTC
Forgot to resolve...