Sorry for the very late reply ...

On Fri, Aug 28, 2015 at 5:24 AM, Mol, Xavier (SCC) <[email protected]>
wrote:

> Hi again,
>
> for some reason I cannot explain, now a couple of things work suddenly as
> expected:
>
> augtool> match $master/*[last()]
> /files/etc/auto.master/3 = +
> augtool> match $master/*[position() = 2]
> /files/etc/auto.master/#comment[1] = Sample auto.master file
> augtool> match $master/*[label() != '#comment'][last()]
> /files/etc/auto.master/3 = +
>
>
> Though not everything does...
>
> augtool> match $master/*[label() != '#comment']
> /files/etc/auto.master/1 = /misc
> /files/etc/auto.master/2 = /net
> /files/etc/auto.master/3 = +
> augtool> match $master/*[label() != '#comment'][position() = 2]
>   (no matches)
>

This is a bona fide bug - "match $master/*[label() != '#comment'][2]" should
absolutely return the $master/2 node.

What's going wrong is that the tree has a bunch of 'hidden' nodes (nodes
whose label is NULL); they weren't being suppressed properly during the
match; in that last match, we actually matched such a hidden node, but when
Augeas goes to print the result it acts as if there was no node (hence the
name 'hidden')

I've put up https://github.com/hercules-team/augeas/pull/323 that fixes
that issue.

David
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to