All the XML parsing is done with the excellent xml.etree.ElementTree standard Python library.
Parse an xml feed, adding packages to the toolchain while doing so
Parameters: |
|
---|
Create a ToolchainFeedParser object, then get the list of parsed packages, and call handle_package() for each package
A class to handle feed parsing
A list of packages, stored as ElementTree objects. The feed where the package came from is stored in a “feed” XML atribute of this package for later use.
A dict name->version used to only keep the latest version of packages
Add a package to self.packages. If an older version of the package exists, replace it by the new version
Handle a package.
Parameters: |
|
---|
Depending on the attribute of the XML object, several functions will be called.
Set the path` attribute of the given package, downloading it and extracting it inside toolchain.cache if necessary.
Set package.path using the feed attribute. Useful when the package path is relative to the feed
For instance with:
<!-- in /path/to/sdk/feed.xml -->
<package name="foo directory="foo" >
package.path will be /path/to/foo
Set package.toolchain_file using package.path The toolchain file path wil always be relative to the package path.
Note: this functions are called in precisely that order.
This means that something like:
<package
name="foo-ctc"
url="http://example.com/packages/foo-ctc.tar.gz"
toolchain_file="cross-config.cmake"
/>
will work.
See also