Index: openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 17 Oct 2010 21:06:09 -0000 1.30 +++ openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 27 Oct 2014 16:40:06 -0000 1.31 @@ -183,18 +183,18 @@ $type] NOTE: Files are no longer stored in info files but are always retrieved directly from the file system. This element in the array will always be the empty list.
  • callbacks: an array list of callbacks of the package - on the form [list callback_type1 proc_name1 callback_type2 proc_name2 ...] + on the form [list callback_type1 proc_name1 callback_type2 proc_name2 ...]
  • Element and attribute values directly from the XML specification: package.key, package.url, package.type + package-name, pretty-plural initial-install-p singleton-p auto-mount - name (the version name, e.g., 3.3a1, + name (the version name, e.g., 3.3a1), url (the version URL), - package-name, option, summary, description, @@ -216,8 +216,6 @@ descriptive error. } { - global ad_conn - # If the .info file hasn't changed since last read (i.e., has the same # mtime), return the cached info list. set mtime [file mtime $path] @@ -257,29 +255,26 @@ apm_log APMDebug "XML: the root name is $root_name" error "Expected as root node" } - set properties(package.key) [apm_required_attribute_value $package key] - set properties(package.url) [apm_required_attribute_value $package url] - set properties(package.type) [apm_attribute_value -default "apm_application" $package type] - set properties(package-name) [apm_tag_value $package package-name] - set properties(initial-install-p) [apm_tag_value -default "f" $package initial-install-p] - set properties(auto-mount) [apm_tag_value -default "" $package auto-mount] - set properties(singleton-p) [apm_tag_value -default "f" $package singleton-p] + set properties(package.key) [apm_required_attribute_value $package key] + set properties(package.url) [apm_required_attribute_value $package url] + set properties(package.type) [apm_attribute_value -default "apm_application" $package type] + set properties(package-name) [apm_tag_value $package package-name] + set properties(initial-install-p) [apm_tag_value -default "f" $package initial-install-p] + set properties(auto-mount) [apm_tag_value -default "" $package auto-mount] + set properties(singleton-p) [apm_tag_value -default "f" $package singleton-p] set properties(implements-subsite-p) [apm_tag_value -default "f" $package implements-subsite-p] - set properties(inherit-templates-p) [apm_tag_value -default "t" $package inherit-templates-p] - set properties(pretty-plural) [apm_tag_value -default "$properties(package-name)s" $package pretty-plural] + set properties(inherit-templates-p) [apm_tag_value -default "t" $package inherit-templates-p] + set properties(pretty-plural) [apm_tag_value -default "$properties(package-name)s" $package pretty-plural] - set versions [xml_node_get_children_by_name $package version] - if { [llength $versions] != 1 } { error "Package must contain exactly one node" } set version [lindex $versions 0] - + set properties(name) [apm_required_attribute_value $version name] - set properties(url) [apm_required_attribute_value $version url] + set properties(url) [apm_required_attribute_value $version url] - # Set an entry in the properties array for each of these tags. foreach property_name { summary description release-date vendor } { set properties($property_name) [apm_tag_value $version $property_name] @@ -296,6 +291,7 @@ foreach { property_name attribute_name } { vendor url + license url description format } { set node [xml_node_get_first_child_by_name $version $property_name] @@ -306,6 +302,14 @@ } } + # Build a list of packages to install additionally + + set properties(install) [list] + foreach node [xml_node_get_children_by_name $version install] { + set install [apm_attribute_value $node package] + lappend properties(install) $install + } + # We're done constructing the properties array - save the properties into the # moby array which we're going to return. @@ -325,7 +329,7 @@ set service_uri [apm_required_attribute_value $node url] set service_version [apm_required_attribute_value $node version] # Package always provides itself, we'll add that below, so don't add it here - if { $dependency_type ne "provides" || ![string equal $service_uri $properties(package.key)] } { + if { $dependency_type ne "provides" || $service_uri ne $properties(package.key) } { lappend properties($dependency_type) [list $service_uri $service_version] } } @@ -339,7 +343,6 @@ array set callback_array {} set callbacks_node_list [xml_node_get_children_by_name $version callbacks] - foreach callbacks_node $callbacks_node_list { set callback_node_list [xml_node_get_children_by_name $callbacks_node callback] @@ -354,9 +357,11 @@ continue } - if { [lsearch -exact [apm_supported_callback_types] $type] < 0 } { + if {$type ni [apm_supported_callback_types]} { # The callback type is not supported - ns_log Error "package info file $path contains an unsupported callback type $type - ignoring. Valid values are [apm_supported_callback_types]" + ns_log Error "package info file $path contains an unsupported\ + callback type $type - ignoring. Valid values are\ + [apm_supported_callback_types]" continue } @@ -370,10 +375,7 @@ # Build a list of the package's owners (if any). set properties(owners) [list] - - set owners [xml_node_get_children_by_name $version owner] - - foreach node $owners { + foreach node [xml_node_get_children_by_name $version owner] { set url [apm_attribute_value $node url] set name [xml_node_get_content $node] lappend properties(owners) [list $name $url] @@ -384,9 +386,7 @@ set properties(parameters) [list] apm_log APMDebug "APM: Reading Parameters" - set parameters [xml_node_get_children_by_name $version parameters] - - foreach node $parameters { + foreach node [xml_node_get_children_by_name $version parameters] { set parameter_nodes [xml_node_get_children_by_name $node parameter] foreach parameter_node $parameter_nodes { @@ -404,7 +404,8 @@ } apm_log APMDebug "APM: Reading parameter $name with default $default_value" - lappend properties(parameters) [list $name $description $section_name $scope $datatype $min_n_values $max_n_values $default_value] + lappend properties(parameters) [list $name $description $section_name $scope \ + $datatype $min_n_values $max_n_values $default_value] } }