Index: openacs-4/packages/acs-bootstrap-installer/installer/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer/index.tcl,v diff -u -r1.8.2.2 -r1.8.2.3 --- openacs-4/packages/acs-bootstrap-installer/installer/index.tcl 2 Apr 2003 00:33:43 -0000 1.8.2.2 +++ openacs-4/packages/acs-bootstrap-installer/installer/index.tcl 4 Apr 2003 02:25:24 -0000 1.8.2.3 @@ -59,6 +59,30 @@ " +if { [file exists [acs_root_dir]/install.xml] } { + + set file [open "[acs_root_dir]/install.xml"] + nsv_set acs_application node [xml_doc_get_first_node_by_name [xml_parse -persist [xml_prepare_data [read $file]]] application] + close $file + + nsv_set acs_application name [apm_required_attribute_value [nsv_get acs_application node] name] + nsv_set acs_application pretty_name \ + [apm_attribute_value -default [nsv_get acs_application name] [nsv_get acs_application node] pretty-name] + nsv_set acs_application home [apm_attribute_value -default "" [nsv_get acs_application node] home] + + append body "

+The installer will automatically install the [nsv_get acs_application pretty_name] +application after the basic OpenACS tookit has been installed. +" + + if { ![string equal [nsv_get acs_application home] ""] } { + append body "

+For more information about the [nsv_get acs_application pretty_name] application visit the +[nsv_get acs_application pretty_name] home page +" + } +} + set error_p 0 # do some error checking. Index: openacs-4/packages/acs-bootstrap-installer/installer/packages-install.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/installer/Attic/packages-install.tcl,v diff -u -r1.3.4.1 -r1.3.4.2 --- openacs-4/packages/acs-bootstrap-installer/installer/packages-install.tcl 5 Mar 2003 14:41:49 -0000 1.3.4.1 +++ openacs-4/packages/acs-bootstrap-installer/installer/packages-install.tcl 4 Apr 2003 02:25:24 -0000 1.3.4.2 @@ -42,7 +42,7 @@ # Complete the initial install. if { ![ad_acs_admin_node] } { - ns_write "

  • Completing Install sequence by mounting the main site and other core packages.

    + ns_write "

  • Mounting the main site and other core packages.

    "
     
         # Mount the main site
    @@ -59,6 +59,96 @@
         apm_mount_core_packages
     
         ns_write "
    " + + # Now mount the application bundle if the install.xml file was found. + + if { [nsv_exists acs_application node] } { + + ns_write "

    Loading packages for the [nsv_get acs_application pretty_name] application.

    " + + set actions [xml_node_get_children_by_name [nsv_get acs_application node] actions] + if { [llength $actions] > 1 } { + ns_log Error "Error in \"install.xml\": only one action node is allowed" + ns_write "

    Error in \"install.xml\": only one action node is allowed

    " + return + } + set actions [xml_node_get_children [lindex $actions 0]] + + foreach action $actions { + + switch -exact [xml_node_get_name $action] { + + text {} + + install { + + set install_spec_files [glob -nocomplain "[acs_root_dir]/packages/[apm_required_attribute_value $action package]/*.info"] + + set pkg_info_list [list] + foreach spec_file [glob -nocomplain "[acs_root_dir]/packages/*/*.info"] { + # Get package info, and find out if this is a package we should install + if { [catch { array set package [apm_read_package_info_file $spec_file] } errmsg] } { + # Unable to parse specification file. + ns_log Error "$spec_file could not be parsed correctly. The error: $errmsg" + } + + # Save the package info, we may need it for dependency satisfaction later + lappend pkg_info_list [pkg_info_new $package(package.key) $spec_file \ + $package(provides) $package(requires) ""] + } + + set dependency_results [apm_dependency_check -pkg_info_all $pkg_info_list $install_spec_files] + + if { [lindex $dependency_results 0] == 1 } { + apm_packages_full_install -callback apm_ns_write_callback [lindex $dependency_results 1] + } + } + + mount { + + set package_key [apm_required_attribute_value $action package] + set instance_name [apm_required_attribute_value $action instance-name] + set mount_point [apm_required_attribute_value $action mount-point] + + set parent_id [site_node::get_node_id -url "/"] + + if { [catch { + db_transaction { + set node_id [site_node::new -name $mount_point -parent_id $parent_id] + } + } error] } { + # There is already a node with that path, check if there is a package mounted there + array set node [site_node::get -url "/$mount_point"] + if { [empty_string_p $node(object_id)] } { + # There is no package mounted there so go ahead and mount the new package + set node_id $node(node_id) + } else { + # Don't unmount already mounted packages + set node_id "" + } + } + + if { ![empty_string_p $node_id] } { + + ns_write "

    Mounting new instance of package $package_key at /$mount_point

    " + site_node::instantiate_and_mount \ + -node_id $node_id \ + -node_name $mount_point \ + -package_name $instance_name \ + -package_key $package_key + + } + + } + + default { + ns_log Error "Error in \"install.xml\": got bad node \"[xml_node_get_name $action]\"" + } + + } + + } + } } ns_write "All Packages Installed."