Hi everyone.
The Derived Manifests project will introduce the ability of controlled
script-driven customizations to AI manifests. The scripts will call a
new command, "aimanifest", to make a manifest modification.
The Derived Manifests specification describes the following subcommands
to "aimanifest" for changing and retrieving manifest values:
set [ -i <path=value,...] <path=value>
get [ -i <path=value,...] <path>
The idea here is that the required <path=value> pair identifies a node
or series of nodes that match <path> to be given <value>; and the "-i
<path=value>" pairs are used to narrow down the search by specifying
certain nodes which exist in the first path, which have a certain
existing value.
Having to specify multiple paths (and repeating the same node within
them) can be tedious and confusing to end users at best, and fail to
work at worst. Specifying a single path which contains values of
intermediate nodes inside it, is more clear and less tedious. For
example, suppose we would want to add another package to uninstall from
an AI target. Currently we would have to say:
aimanifest add -i
/auto_install/ai_instance/software/software_d...@action="uninstall" \
/auto_install/ai_instance/software/software_data/name pkg:/uninstall-me
This could become even more painful if multiple "-i" pairs are needed to
further narrow down a search. With proposed changes, this command
condenses to:
aimanifest add
/auto_install/ai_instance/software/software_da...@action="uninstall"]/name
pkg:/uninstall-me
Original syntax becomes impossible to use in some cases. Consider a
case where, in order to match a specific node, a "-i" pair goes down a
tangential path to match a child node. Here is a contrived example to
illustrate:
A
/ \
B B
/ \ / \
C(1) C(2) C(1) C(3)
Change the C with value 1 on the left B, to value 5: specify the left B
by matching its child C with value 2 which only exists under the left B.
This cannot be done with the original syntax, because the C to change
cannot be differentiated from the C not to change. The best we can do is:
aimanifest set -i /A/B/C=2 /A/B/C 5
but this does not specify explicitly enough which C to change.
A solution to this is to embed the values inside the path itself. I
propose the following. It is modeled on xpath because xpath is a
standard, but implements only a subset of it in order to keep it
simple. There is one addition to the xpath syntax, to make it simpler.
See "path details" below for a syntactic breakdown of the path.
In the A-B-C example this would be A/B[C=2]/C[.=1] or A/B[C=2]/C=1
This clearly denotes where the tangent paths and values fit into the
main path, and simplifies the specification down to a single path. It
says, the path contains the B with the C child of value 2 (B[C=2]) and
then specifies which C to change (C=1 or C[.=1]).
Changes to Design Spec
----------------------
This change would be for both the aimanifest command and for the
ManifestInput module methods add/set/get.
Please see sections 5.2.4 and 5.2.5 of the proposed Design Spec V.91 for
the proposed changes:
http://hub.opensolaris.org/bin/download/Project+caiman/DerivedManifests/DerivedManifestsDesignSpec.pdf
Diffs of changes between v0.9 and v0.91:
http://hub.opensolaris.org/bin/download/Project+caiman/DerivedManifests/DerivedManifestsDesignSpecv90v91diffs.pdf
Please let me know by Tuesday 11/23 COB if you have comments, questions
or concerns.
Path details
------------
Define a "branch" to be the contents between two slashes in a nodepath;
it represents a node along the nodepath used to get to the final node.
Here's the BNF grammar. Note that "[" and "]" here are literal symbols.
nodepath :== /leaf | /branch/nodepath
leaf :== tag | tag=value | tag[.=value] | tag[identifier] | t...@attr
branch :== tag | tag=value | tag[.=value] | tag[identifier] |
tag[subpath=value]
subpath :== leaf | branch/subpath (like nodepath but relative to
current node)
where
* tag* is a node's tag or name
* value* is a node or attribute's value
* identifier* is a numeric id that uniquely identifies a node from
its siblings
The stuff inside the [] are values or other identification to narrow
down to a specific element at the current level in the tree. "=value"
is a shortcut for "[.=value]".
"subpath" can include nodes and a final attr, as tag/tag, tag/t...@attr,
t...@attr or @attr
Thanks,
Jack
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss