From owner-freebsd-java@FreeBSD.ORG Wed Mar 26 08:50:55 2003 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C0B337B404 for ; Wed, 26 Mar 2003 08:50:55 -0800 (PST) Received: from alicia.nttmcl.com (alicia.nttmcl.com [216.69.69.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id A454243FAF for ; Wed, 26 Mar 2003 08:50:54 -0800 (PST) (envelope-from jj@alicia.nttmcl.com) Received: from alicia.nttmcl.com (localhost [127.0.0.1]) by alicia.nttmcl.com (8.12.5/8.12.5) with ESMTP id h2QGosvm022794 for ; Wed, 26 Mar 2003 08:50:54 -0800 (PST) (envelope-from jj@alicia.nttmcl.com) Received: (from jj@localhost) by alicia.nttmcl.com (8.12.5/8.12.5/Submit) id h2QGosDH022793 for freebsd-java@freebsd.org; Wed, 26 Mar 2003 08:50:54 -0800 (PST) Date: Wed, 26 Mar 2003 08:50:54 -0800 From: Shannon -jj Behrens To: freebsd-java@freebsd.org Message-ID: <20030326165054.GA22072@alicia.nttmcl.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Spam-Status: No, hits=-6.4 required=5.0 tests=USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Subject: jar dependencies X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2003 16:50:56 -0000 I apologize that this email isn't a direct response to the earlier email about jar dependencies. I have a habit of deleting things too quickly ;) The problem is that the author of the previous email has 27 copies and 15 flavors of Ant on his system, but none of us really has time to convince the whole Java world to be more cooperative about dependencies. Naturally, the RIGHT THING would be to have each jar dependency placed in its own port, and each Java port would depend on a set of jar ports. Versioning would be a pain (imagine 15 flavors of the Ant port), but things would sit nicely with hier, and it would feel like FreeBSD. At the risk of being flamed to death, I propose the following novel approach. Everything Java should be installed in /usr/java. Each Java port should simply be wholly copied to /usr/java/$port_name. Then, for each dependency jar found in /usr/java/$port_name (via find), the following logic would take place: if that jar is already present in /usr/java/lib, hardlink to that file in /usr/java/lib. Otherwise, move that jar to /usr/java/lib and then hardlink to that file. When removing a Java port, simply delete the /usr/java/$port_name directory. Optionally, clean up the /usr/java/lib directory by deleting any files who have a refcount of 1 (i.e. jar files that are used by any Java port). I've noticed that the jar files don't seem to have any version information. Hence, the above procedure will need to be complicated to take this into mind. I.e., when copying the jar to /usr/java/lib, copy it to /usr/java/lib/$jar_name-$arbitrary_version. When trying to find if a given jar file is already present in /usr/java/lib, compare that jar file (using diff) to each jar file in /usr/java/lib/$jar_name-*. Naturally, all of the above maintenance of /usr/java/lib could be wrapped up in a simple program (probably just a shell script) that would be invoked by the port. I realize that this is quite a break from the standard way FreeBSD does things. In fact, I'd be surprised if anyone took me seriously. However, I would like to point out that since Java is practically an OS unto itself, it's not totally unreasonable that it must be treated in a special manner. Best Regards, -jj -- Hacker is to software engineer as Climbing Mt. Everest is to building a Denny's there.