apm_dependency_provided_p (public)
apm_dependency_provided_p [ -dependency_list dependency_list ] \ dependency_uri dependency_version
Defined in packages/acs-tcl/tcl/apm-install-procs.tcl
Returns 1 if the current system provides the dependency inquired about. Returns -1 if the version number is too low. Returns 0 otherwise.
- Switches:
- -dependency_list (optional, defaults to
"[list]"
)- Specify this if you want to a check a list of dependencies of form {dependency_name dependency_version} in addition to querying the database for what the system currently provides.
- Parameters:
- dependency_uri (required)
- The dependency that is being checked.
- dependency_version (required)
- The version of the dependency being checked.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set old_version_p 0 set found_p 0 ns_log Debug "apm_dependency_provided_p: Scanning for $dependency_uri version $dependency_version" foreach service_version [db_list get_service_versions {}] { set version_p [expr {[apm_version_names_compare $service_version $dependency_version] >= 0}] if { $version_p } { ns_log Debug "apm_dependency_provided_p: Dependency satisfied by previously installed package" set found_p 1 } else { set old_version_p 1 } } # Can't return while inside a db_foreach. if {$found_p} { return 1 } if { $dependency_list ne "" } { # They provided a list of provisions. foreach prov $dependency_list { if {$dependency_uri eq [lindex $prov 0]} { set provided_version [lindex $prov 1] set provided_p [expr {[apm_version_names_compare $provided_version $dependency_version] >= 0}] if { $provided_p } { ns_log Debug "apm_dependency_provided_p: Dependency satisfied in list of provisions." return 1 } else { set old_version_p 1 } } } } if { $old_version_p} { return -1 } else { return 0 }Generic XQL file: <fullquery name="apm_dependency_provided_p.get_service_versions"> <querytext> select service_version from apm_package_dependencies d, apm_package_types a, apm_package_versions v where d.dependency_type = 'provides' and d.version_id = v.version_id and d.service_uri = :dependency_uri and v.installed_p = 't' and a.package_key = v.package_key </querytext> </fullquery>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