OpenCSW Bug Tracker


Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001892 [firefox] regular use major always 2006-10-28 05:47 2009-05-10 22:51
Reporter james View Status public  
Assigned To wbonnet
Priority normal Resolution fixed  
Status closed  
Summary 0001892: pkgrm removes any Java plugin
Description postinstall copies the java lib to the plugin directory if it can find one. preremove *always* removes it irrespective of whether postinstall added it. I suggest that if it\'s copied on install then the file is added to the package with installf(1M) so it is naturally removed on pkgrm.

Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0004138)
jgoerzen (developer)
2006-10-30 12:07

CSWfirefox.preremove script updated to check for SUNWj3rt, if it is installed then remove the symbolic link that was installed during postinstall.


#!/bin/sh
#
# Blastwave.org Firefox Community Edition preremove script

FIREFOX_VERSION=firefox-2.0

pkginfo -q SUNWj3rt
if [ $? -eq 0 ]; then
rm /opt/csw/libexec/firefox/lib/${FIREFOX_VERSION}/plugins/libjavaplugin_oji.so
fi

exit 0
(0004140)
james (reporter)
2006-10-30 12:29
edited on: 2006-10-30 12:31

Why not put this in postinstall, then forget about it, ie, no need for preremove because the link becomes part of the package.

if pkginfo -q SUNWj3rt ; then

    # create the link as now
    #

    ROOT=${PKG_INSTALL_ROOT}
    [ -z \"${ROOT}\" ] && ROOT=/

    installf -R ${ROOT} ${PKGINST} ${PLUGIN_PATH}/libjavaplugin_oji.so s || exit 2
    installf -R ${ROOT} -f ${PKGINST} || exit 2
fi



This is slightly better because:
* the state of SUNWj3rt might have changed
* there is no need for a preremove
* the package database knows the link is part of the package

edited on: 10-30 12:31
(0004144)
james (reporter)
2006-10-30 18:46

postinstall uses SUNWj3rt which is the old 1.4 JDK. The newer 1.5 package is called SUNWj5rt and is the one anyone would want (until JDK 6...)

$ pkginfo SUNWj3rt
system SUNWj3rt J2SDK 1.4 runtime environment
$ pkginfo SUNWj5rt
system SUNWj5rt JDK 5.0 Runtime Env. (1.5.0_06)

The SUNWj5r plugin is:
/usr/jdk/instances/jdk1.5.0/jre/plugin/$(uname -p)/ns7/libjavaplugin_oji.so
or using the \"latest\" link:
/usr/jdk/latest/jre/plugin/$(uname -p)/ns7/libjavaplugin_oji.so

or more generally:
${JAVAHOME}/jre/plugin/$(uname -p)/ns7/libjavaplugin_oji.so
because, eg, I generally don\'t use the packaged JRE/JDKs

It might be reliable to use path to the java executable, or another way to find Java home (ignoring any env var) is to run Java:
$ java JavaHome
/opt/jdk1.5.0_07
$ PLUGIN=`java JavaHome`/jre/plugin/`uname -p`/ns7/libjavaplugin_oji.so


Source:
/**
 * Utility to print the system property java.home value.
 */

public class JavaHome
{
    public static void main(String[] argv)
    {
        String home = System.getProperty(\"java.home\");
        System.out.println(home.substring(0, home.lastIndexOf(\'/\'))); // remove the \"/jre\"
    }
}


I\'ll try to think of an easy way to check all installed JREs and find the latest plugin.
(0006086)
wbonnet (manager)
2009-05-10 22:51

fixed since a few months


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker