users@glassfish.java.net

Setting up updatecenter package for clean removal?

From: Laird Nelson <ljnelson_at_gmail.com>
Date: Wed, 10 Aug 2011 14:14:29 -0400

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