openjdk8 (or possibly javavmwrapper) has a softlinked /usr/local/bin/jps to /usr/local/bin/javavm which appears to be unknown to pkg: ❯sudo pkg install -y openjdk8-8.60.24 .... ❯pkg which /usr/local/bin/jps /usr/local/bin/jps was not found in the database ❯which jps /usr/local/bin/jps ❯l /usr/local/bin/jps lrwxr-xr-x 1 root wheel 21B Dec 3 09:46 /usr/local/bin/jps@ -> /usr/local/bin/javavm This conflicts when installing sysutils/jps. BTW should pkg complain when it overwrites an existing file silently, even if it's not somehow in the pkg database? This is actually what happened that caused me to dig into this.
Fix Summary and assign correctly.
What would be an appropriate fix by your opinion? The standard install utility used to install package files for sysutils/jps usually either owerwrites files or may rename them if there is an option set. The same way as many packages do, although the current install sheme mignt have changed since the latest port update.
Hi Pavel, as a new comer to FreeBSD my POLA was that: 1. all files,links,resources installed by a package should be registered in pkg db 2. conflicting pkg/ports should be marked as such (or resolved!) 3. pkg itself should warn or possibly fail to install conflicts unless --force or similar flag is given I see 2 things to do here: 1. decide what, if anything to do about POLA#1 for openjdk8, assuming pkg can track softlinks. 2. decide what to do about POLA#2 and POLA#3 for pkg. I can raise another ticket if required but I'd like to see one of the pkg people at least comment on this thread first. Sounds sensible to you?
Re-assign to the maintainer.
It's not the openjdk8 package itself that creates these links. The openjdk8 package execs javavm's registervm as part of installing itself. It is that which creates the symlinks. I can't think of a simple way for the package to handle this. If its a problem then the best thing to do is to create a CONFLICTS entry for the two. Note that installing openjdk7 or openjdk6 will have the same effect.
jps used in many systems for java processes. So I thing sysutils/jps should rename the jps program, if possible.
I submitted a trivial patch for CONFLICTS against sysutils/jps. What is the best way to handle this for the various *jdk ports? java/openjdk6/ java/openjdk6-jre/ java/openjdk7/ java/openjdk7-jre/ java/openjdk8/ java/openjdk8-jre/
To avoid this ticket festering, I will push to get the jps CONFLICTS patch committed, but for me there are still unanswered questions from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204989#c3 - should the various jdk packages somehow inform pkg(8) of their use of /usr/local/bin/jps or not? - does it make sense to add a CONFLICTS to the openjdk packages too?
Is this still relevant?