• 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

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)

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)

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:

  • path: a path to the file read
  • mtime: the mtime of the file read
  • provides, embeds, extends, and requires:

    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, and description.format, maturity, maturity_text.
This routine will typically be called like so:
array set version_properties [apm_read_package_info_file $path]
to populate the version_properties array.

If the .info file cannot be read or parsed, this routine throws a descriptive error.

Parameters:
path (required)

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)

Testcases:
No testcase defined.
[ show source ]