Index: openacs-4/packages/acs-admin/www/apm/packages-install.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-admin/www/apm/packages-install.tcl 17 Oct 2010 21:06:07 -0000 1.22 +++ openacs-4/packages/acs-admin/www/apm/packages-install.tcl 27 Oct 2014 16:38:52 -0000 1.23 @@ -9,16 +9,19 @@ {checked_by_default_p:boolean 0} } -ad_return_top_of_page "[apm_header "Package Installation"] -

Please wait while the installer searches your system for packages to install ...

+set title "Package Installation" +set context [list [list "/acs-admin/apm/" "Package Manager"] $title] -" ### Get all the spec files -# If a package is in the apm_workspace dir then we assume that that is the package that -# should be installed and we ignore any such package in the packages dir. +# +# If a package is in the apm_workspace dir then we assume that that is +# the package that should be installed and we ignore any such package +# in the packages dir. +# # TODO: make sure that it's a later version than that in the packages dir? -set packages_root_dir "[acs_root_dir]/packages" +# +set packages_root_dir "$::acs::rootdir/packages" set packages_spec_files [apm_scan_packages $packages_root_dir] set workspace_spec_files [apm_scan_packages [apm_workspace_install_dir]] set workspace_filenames [list] @@ -28,7 +31,7 @@ set all_spec_files $workspace_spec_files foreach spec_path $packages_spec_files { set spec_filename [file tail $spec_path] - if { [lsearch -exact $workspace_filenames $spec_filename] == -1 } { + if {$spec_filename ni $workspace_filenames} { lappend all_spec_files $spec_path } } @@ -51,55 +54,59 @@ lappend spec_files $spec_file } else { ns_log Notice "need upgrade of package $package_key $version_name" - lappend already_installed_list "Package "$package_name" ($package_key) version $version_name or higher is already installed." + lappend already_installed_list \ + "Package $package_name ($package_key): version $version_name or higher is already installed." } } else { lappend spec_files $spec_file } } else { - lappend not_compatible_list "Package "$package_name" ($package_key) doesn't support [db_type]." + lappend not_compatible_list "Package $package_name ($package_key): doesn't support [db_type]." } } apm_log APMDebug $spec_files -ns_write "Done.

-" +set body "" if { $spec_files eq "" } { # No spec files to work with. - ns_write " -

No New Packages to Install

+ append body [subst { +

No New Packages to Install

- There are no new packages to install. Please load some - using the Package Loader.

- Return to the APM.

- " + There are no new packages to install. Please load some + using the Package Loader.

+ Return to the APM.

+ }] } else { - ns_write " -

Select Packages to Install

-

Please select the set of packages you'd like to install.

" + append body { +

Select Packages to Install

+

Please select the set of packages you'd like to install.

+ } - ns_write " + set formName "pkgsForm" + append body [subst { - -uncheck all boxes | -check all boxes -" + + uncheck all boxes | + check all boxes + }] - ns_write "
" + append body "\n" # Client properties do not deplete the limited URL variable space. # But they are limited to the maximum length of a varchar ... @@ -111,44 +118,43 @@ set pkg_key_list [list] apm_log APMDebug "APM: Specification files available: $spec_files" foreach spec_file $spec_files { - ### Parse the package. - if { [catch { - array set package [apm_read_package_info_file $spec_file] - } errmsg] } { - lappend errors "
  • Unable to parse $spec_file. The following error was generated: -
    [ad_quotehtml $errmsg]

    " - } else { - apm_log APMDebug "APM: Adding $package(package.key) to list for installation." - lappend pkg_info_list [pkg_info_new $package(package.key) $spec_file \ - $package(embeds) $package(extends) $package(provides) $package(requires) ""] + ### Parse the package. + if { [catch { + array set package [apm_read_package_info_file $spec_file] + } errmsg] } { + lappend errors "

  • Unable to parse $spec_file. The following error was generated: +
    [ad_quotehtml $errmsg]

    " + } else { + apm_log APMDebug "APM: Adding $package(package.key) to list for installation." + lappend pkg_info_list [pkg_info_new $package(package.key) $spec_file \ + $package(embeds) $package(extends) $package(provides) $package(requires) ""] lappend pkg_key_list $package(package.key) - } + } } - + if { $checked_by_default_p } { - set widget [apm_package_selection_widget $pkg_info_list $pkg_key_list $pkg_key_list] + set widget [apm_package_selection_widget $pkg_info_list $pkg_key_list] } else { set widget [apm_package_selection_widget $pkg_info_list] } if {$widget eq ""} { - ns_write "There are no new packages available.

    - [ad_footer]" - ad_script_abort + append body "There are no new packages available." + ad_script_abort } + + append body $widget + append body [subst { + +

  • + }] - ns_write $widget - ns_write " - \"> - - " - if {$errors ne ""} { - ns_write "The following errors were generated - - " + append body "The following errors were generated + + " } } @@ -159,9 +165,11 @@ if { [llength $already_installed_list] > 0 } { ns_log Notice "APM packages-install: Already Installed Packages\n- [join $already_installed_list "\n- "]" } +ad_return_template apm - - -ns_write " -[ad_footer] -" +# +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: