- Publicity: Public Only All
apm-xml-procs.tcl
Functions that APM uses to parse and generate XML.
- Location:
- packages/acs-tcl/tcl/apm-xml-procs.tcl
- Created:
- Fri Oct 6 21:47:39 2000
- Authors:
- Bryan Quinn <bquinn@arsdigita.com>
- Ben Adida <ben@mit.edu>
- Bart Teeuwisse <bart.teeuwisse@thecodemill.biz>
- CVS Identification:
$Id: apm-xml-procs.tcl,v 1.35 2024/09/11 06:15:48 gustafn Exp $
Procedures in this file
- apm_attribute_value (public)
- apm_generate_package_spec (public)
- apm_read_package_info_file (public)
- apm_required_attribute_value (public)
- apm_tag_value (private)
Detailed information
apm_attribute_value (public)
apm_attribute_value [ -default default ] element attribute
Parses the XML element to return the value for the specified attribute.
- Switches:
- -default (optional)
- Parameters:
- element (required)
- attribute (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- apm__test_info_file
apm_generate_package_spec (public)
apm_generate_package_spec version_id
Generates an XML-formatted specification for a version of a package.
- Parameters:
- version_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- apm__test_info_file
apm_read_package_info_file (public)
apm_read_package_info_file path
Reads a .info file, returning an array containing the following items:
This routine will typically be called like so:
path
: a path to the file readmtime
: the mtime of the file readprovides
,embeds
,extends
, andrequires
:lists of dependency information, containing elements of the form
[list $url $version]
owners
: a list of owners containing elements of the form[list $url $name]
files
: a list of files in the package, containing elements of the form[list $path $type]
NOTE: Files are no longer stored in info files but are always retrieved directly from the filesystem. 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 ...]
- 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
),url
(the version URL),option
,summary
,description
,release-date
,vendor
,group
,vendor.url
, anddescription.format
,maturity
,maturity_text
.to populate thearray set version_properties [apm_read_package_info_file $path]version_properties
array.If the .info file cannot be read or parsed, this routine throws a descriptive error.
- Parameters:
- path (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- apm__test_info_file, files__check_info_files
apm_required_attribute_value (public)
apm_required_attribute_value element attribute
Returns an attribute of an XML element, throwing an error if the attribute is not set.
- Parameters:
- element (required)
- attribute (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
apm_tag_value (private)
apm_tag_value [ -default default ] root property_name
Parses the XML element and returns the associated property name if it exists.
- Switches:
- -default (optional)
- Parameters:
- root (required)
- property_name (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.