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 -N -r1.11.2.3 -r1.11.2.4 --- openacs-4/packages/acs-admin/www/install/install-3.tcl 28 Oct 2020 15:39:18 -0000 1.11.2.3 +++ openacs-4/packages/acs-admin/www/install/install-3.tcl 24 Apr 2022 16:58:09 -0000 1.11.2.4 @@ -45,30 +45,30 @@ while {[llength $to_install] > 0} { foreach package_key $to_install { - array unset version - array set version $repository($package_key) + array unset version + array set version $repository($package_key) - set satisfied_p 1 - foreach req [concat $version(embeds) $version(extends) $version(requires)] { - lassign $req pkg req_version + set satisfied_p 1 + foreach req [concat $version(embeds) $version(extends) $version(requires)] { + lassign $req pkg req_version - # - # A package can be installed, when its requirements are - # installed before the package. All other dependencies - # were checked earlier. - # + # + # A package can be installed, when its requirements are + # installed before the package. All other dependencies + # were checked earlier. + # - if { $pkg in $to_install } { - set satisfied_p 0 - #ns_log notice "we have to delay $pkg" - break - } - } - if {$satisfied_p} { - lappend install_order $package_key - set pos [lsearch $to_install $package_key] - set to_install [lreplace $to_install $pos $pos] - } + if { $pkg in $to_install } { + set satisfied_p 0 + #ns_log notice "we have to delay $pkg" + break + } + } + if {$satisfied_p} { + lappend install_order $package_key + set pos [lsearch $to_install $package_key] + set to_install [lreplace $to_install $pos $pos] + } } #ns_log notice "iteration: \nto_install: $to_install\ninstall_order: $install_order" } @@ -85,10 +85,10 @@ foreach package_key $install_order { ns_log Notice "Installing $package_key" - + array unset version array set version $repository($package_key) - + if { [info exists version(download_url)] && $version(download_url) ne "" } { ns_write [subst {

Transferring $version(download_url) ... @@ -134,7 +134,7 @@ if { [apm_package_upgrade_p $package_key $final_version_name] == 1} { ns_log Debug "Upgrading package [string totitle $version(package-name)] to $final_version_name." set upgrade_p 1 - + set initial_version_name [apm_highest_version_name $package_key] } else { set upgrade_p 0 @@ -151,10 +151,10 @@ ns_log Debug "Data model scripts: \nupgrade_from_version_name = $initial_version_name\nupgrade_to_version_name=$final_version_name\npackage_path=$package_path\npackage_key=$package_key\n => $data_model_files" ns_write [subst { -

Installing $package_key ...
- +

Installing $package_key ...
+ }] - + # Install the package -- this actually copies the files into the # right place in the filesystem and backs up any old files @@ -165,14 +165,14 @@ -load_data_model \ -data_model_files $data_model_files \ $spec_file] - + if { $version_id == 0 } { # Installation of the package failed and we shouldn't continue with installation # as there might be packages depending on the failed package. Ideally we should # probably check for such dependencies and continue if there are none. set success_p 0 } else { - ns_write "... installation OK
\n" + ns_write "... installation OK
\n" } if {$success_p} { @@ -189,7 +189,7 @@ # - 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 @@ -201,7 +201,7 @@ # # NaviServer variant: # - nstrace::statescript produces the blueprint - # - "ns_ictl save" updates it in the server + # - "ns_ictl save" updates it in the server # ns_ictl save [nstrace::statescript] ns_write "... blueprint updated
\n" @@ -225,10 +225,20 @@ ns_ictl markfordelete } ns_write [subst { - + }] } +if {$success_p && [namespace which ::nstrace::statescript] ne ""} { + + foreach package_key $install_order { + apm_bootstrap_load_libraries -init $package_key + ns_write "$package_key: loading init files done" + ns_log notice "$package_key: loading init files done" + } + ns_ictl save [nstrace::statescript] +} + ##### # # Done