ports/java/javavmwrapper/files/pkg-install.in
Baptiste Daroussin 64f16bafaf Remove the deinstall script that appears to be deleting all the temporary files
created by pkg(8) during upgrades

It happens because the deinstall script tries to clean up the potential manual
VM registration by cleaning out all symlinks to bin/javavm

Given all VM are registring/unregistering themselves this part is not needed

The other thing the script was doing handling the configuration which has been
replaced by @sample.

pkg-install has been modified to drop the handling of the configuration file but
keep the auto registration if all VM found. While this part is not necessary as
well, we keep it because otherwise anyone doing delete/install on javavmwapper
version 2.5 being the installed version would end up with all VM unregistered.

The pkg-install should be removed after EOL of FreeBSD 10.3

PR:		210313
MFH:		2016Q3
2016-07-31 12:30:24 +00:00

25 lines
728 B
Bash

#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/java/javavmwrapper/files/pkg-install.in,v 1.3 2006-06-03 17:32:24 glewis Exp $
LOCALBASE=%%LOCALBASE%%
# This script runs during post-install
if [ "x${2}" != "xPOST-INSTALL" ]; then
exit 0
fi
# Ensure all JDKs and JREs are installed
_excl_dirs='bootstrap-openjdk'
_find_expr='-depth 2 -regex .*/bin/java'
for dir in ${_excl_dirs}; do
_find_expr="${_find_expr} ! -regex ${dir}/bin/java"
done
for jvm in `cd "${LOCALBASE}" && find *jdk* *jre* ${_find_expr} 2> /dev/null`; do
if [ -x "${LOCALBASE}/${jvm}" ]; then
"${PKG_PREFIX}"/bin/registervm "${LOCALBASE}/${jvm}" > /dev/null 2>&1
fi
done
# Ensure all VMs are configured correctly
"${PKG_PREFIX}"/bin/checkvms