users@glassfish.java.net

Re: Setting up updatecenter package for clean removal?

From: Snjezana Sevo-Zenzerovic <snjezana.sevozenzerovic_at_oracle.com>
Date: Wed, 10 Aug 2011 11:40:44 -0700 (PDT)

Laird,

FWIW, installing IPS controlled content under domains/domain1 directory is problematic approach since domains/domain1 files are generally handled as configuration data which is created on the fly and is not under IPS control. Uninstall behavior you are running into is pretty much the side-effect of it - if IPS installs file under glassfish/domains/domain1/applibs directory, it will assume that it owns all directories in the path even if they already existed and had independently created content. Exception are files/directories referenced by some other IPS package which is not being uninstaller - for instance, the reason glassfish/domains is spared is that it is defined as glassfish-nucleus IPS package content.

I need to better understand the use case, but the ideal solution from IPS file layout standpoint would be to install Hibernate libraries into a directory outside of glassfish/domain/domain1, for instance, something like glassfish/hibernate/lib .

Thanks,

Snjezana

----- Original Message -----
From: ljnelson_at_gmail.com
To: users_at_glassfish.java.net
Sent: Wednesday, August 10, 2011 11:14:59 AM GMT -08:00 US/Canada Pacific
Subject: Setting up updatecenter package for clean removal?

Hello; as part of putting together my Hibernate JPA provider support for the Glassfish Update Center, I have successfully created an IPS package that installs files in the right location.

However, when I ask the update center to remove this package, it ends up deleting the entire domain1 directory. Not quite what we want. :-)

Per Alexis' instructions, I've got a prototype.py file that looks like this (apologies to forum users who will not see this formatted, and to Python programmers, of which I am not one):

pkg = {
"name" : "hibernate",

# From http://www.unix.com/man-page/OpenSolaris/5/pkg/ :
# "The version follows the package name, separated by an '@'. It
# consists of four sequences of numbers, separated by punctuation.
# The elements in the first three sequences are separated by dots,
# and the sequences are arbitrarily long."
"version" : "${ipsCompatibleHibernateVersion}-0.3",

"attributes" : {
"pkg.summary" : "Hibernate JPA",
"pkg.description" : "Hibernate JPA provider for GlassFish Application Server instance. After this module is successfully installed you can use Hibernate as a persistence provider for your JPA applications. For more information read hibernate/overview.txt.",
"info.classification" : "Frameworks",
},

"dirtrees" : [ "glassfish/domains/domain1/applibs/hibernate-${hibernateVersion}" ],
"files" : { "glassfish/domains/domain1/applibs/${project.artifactId}-${version}.jar" : { }, },
"licenses" : {
"${basedir}/LICENSE.txt" : {"license" : "GNU LESSER GENERAL PUBLIC LICENSE"},
},
}

The only documentation I am aware of--there are probably more--is here: http://download.java.net/updatecenter2/promoted/latest/pkg-toolkit-docs/common/proto.html

(In the above snippet, please ignore the ${variables} ${that} ${look} ${like} ${this} ; Maven will substitute them with appropriate values.)

I can't figure out which combination of " files ", " dirtrees " and " dirs " will allow the update center to actually remove this package cleanly. Any help is appreciated.

Best,
Laird