Index: openacs-4/packages/acs-admin/www/install/install-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/install/install-3.tcl,v diff -u -r1.10.2.11 -r1.10.2.12 --- openacs-4/packages/acs-admin/www/install/install-3.tcl 1 Aug 2017 09:20:10 -0000 1.10.2.11 +++ openacs-4/packages/acs-admin/www/install/install-3.tcl 1 Aug 2017 11:03:53 -0000 1.10.2.12 @@ -173,13 +173,57 @@ set success_p 0 } else { ns_write "... installation OK
\n" - ns_eval [subst { - apm_load_libraries -procs -force_reload -packages $package_key - apm_load_queries -packages $package_key - apm_load_libraries -init -force_reload -packages $package_key - }] - ns_write "... updated blueprint
\n" } + + if {$success_p} { + # + # The update has finished successfully. Since all the new + # files were sourced, the actual connection thread is already + # up to date. In order to provide this code to the other + # threads, it is necessary to update the internal + # blueprint. This works different in NaviServer and AOLserver, + # and is supported only by NaviServer for the time being. + # + # Other options: + # + # - run apm_package_install via "ns_eval": does not work, + # since "ns_eval" runs a script twice, a package can only + # be installed once. + # + # - run parts of apm_package_install: e.g. loading just the + # procs does not work, when it depends e.g. on package + # parameters, which have as well be updated in the + # blueprint. + # + # - fix the behavior in AOLserver + # + if {[info commands ::nstrace::statescript] ne ""} { + # + # NaviServer variant: + # - nstrace::statescript produces the blueprint + # - "ns_ictl save" updates it in the server + # + ns_ictl save [nstrace::statescript] + ns_write "... blueprint updated
\n" + } else { + # + # AOLserver: _ns_savenamespaces produces the update script + # and updates the blueprint, .... but it kills the + # internal state of the server. After running this + # command, e.g. all ns_sets are gone, later commands run + # into problems. + # + # _ns_savenamespaces + } + } else { + # + # At least one update has failed. Since it is not clear whether or + # not library files were sourced, it is necessary to delete this + # thread asap to avoid potential confusion with already updated + # procs. + # + ns_ictl markfordelete + } ns_write { }