apm_simple_package_install (public)

 apm_simple_package_install package_key

Defined in packages/acs-tcl/tcl/apm-install-procs.tcl

Simple basic package install function. Wraps up basically what the old install XML action did.

Parameters:
package_key (required)

Partial Call Graph (max 5 caller/called nodes):
%3 install::xml::action::install install::xml::action::install (public) apm_simple_package_install apm_simple_package_install install::xml::action::install->apm_simple_package_install apm_dependency_check apm_dependency_check (private) apm_simple_package_install->apm_dependency_check apm_package_info_file_path apm_package_info_file_path (public) apm_simple_package_install->apm_package_info_file_path apm_package_installed_p apm_package_installed_p (public) apm_simple_package_install->apm_package_installed_p apm_package_supports_rdbms_p apm_package_supports_rdbms_p (public) apm_simple_package_install->apm_package_supports_rdbms_p apm_packages_full_install apm_packages_full_install (private) apm_simple_package_install->apm_packages_full_install

Testcases:
No testcase defined.
Source code:
    set install_spec_file [apm_package_info_file_path $package_key]

    if { [catch {
        array set package [apm_read_package_info_file $install_spec_file]
    } errmsg] } {
        # Unable to parse specification file.
        error "install: $install_spec_file could not be parsed correctly.  The error: $errmsg"
        return
    }

    if { ![apm_package_supports_rdbms_p -package_key $package(package.key)]
         || [apm_package_installed_p $package(package.key)]
     } {
        ns_log notice "apm_simple_package_install: no need to install $package(package.key)"
        return
    }

    set pkg_info_list [list]
    foreach spec_file [glob -nocomplain "$::acs::rootdir/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.
            error "install: $spec_file could not be parsed correctly.  The error: $errmsg"
        }

        if { [apm_package_supports_rdbms_p -package_key $package(package.key)]
             && ![apm_package_installed_p $package(package.key)]
         } {
            # 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(embeds)  $package(extends)  $package(provides)  $package(requires)  ""]
        }
    }

    set dependency_results [apm_dependency_check  -pkg_info_all $pkg_info_list  $install_spec_file]

    if { [lindex $dependency_results 0] == 1 } {
        apm_packages_full_install -callback apm_ns_write_callback [lindex $dependency_results 1]
    } else {
        foreach package_spec [lindex $dependency_results 1] {
            if {[string is false [pkg_info_dependency_p $package_spec]]} {
                append err_out "install: package \"[pkg_info_key $package_spec]\"[join [pkg_info_comment $package_spec] ,]\n"
            }
        }
        error $err_out
    }
Generic XQL file:
packages/acs-tcl/tcl/apm-install-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-install-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-install-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: