Hello Everyone,
I was wondering if anybody has tried using before-install callbacks.
I have been trying to use it but it seems that the before install callback is not being called at all.
I traced it to the apm_install_procs and the apm_procs inside acs-tcl.
It seems that before-install callbacks are invoked by a proc that queries them from a table which stores the callbacks for various packages.
The problem is that this table doesn't get populated with the callbacks for the package being installed until after SQL files have been loaded and just prior to after-install callbacks.
In apm_install_procs.tcl, the before-install callbacks are done here
*************
if { $upgrade_p } {
# Run before-upgrade
apm_invoke_callback_proc -version_id $version_id -type before-upgrade -arg_list [list from_version_name $upgrade_from_version_name to_version_name $version(name)]
} else {
# Run before-install
apm_invoke_callback_proc -version_id $version_id -type before-install
}
***********
Note that apm_invoke_callback_proc calls apm_get_callback_proc which queries the apm_package_callbacks table.
************************
set proc_name [apm_get_callback_proc \
-version_id $version_id \
-package_key $package_key \
-type $type]
***********************
The problem here is that the apm_package_callbacks table will not have the before-install callbacks yet because
************************
apm_package_install_callbacks -callback $callback $version(callbacks) $version_id
***********************
is not called until much later in package installation.
Has anybody enountered the same problem ? Any work arounds ?
Is this a bug ?
Best,
Hamilton