[augeas-devel] Inconsistent matching of multiple predicates (involving last/position)

Mol, Xavier (SCC) xavier.mol at kit.edu
Fri Aug 28 09:01:31 UTC 2015


Thank you for your quick reply, Dominic!

I'll see if I can update Augeas first.

Best regards,
Xavier.

> -----Original Message-----
> From: Dominic Cleal [mailto:dcleal at redhat.com]
> Sent: Friday, August 28, 2015 10:58 AM
> To: Mol, Xavier (SCC)
> Cc: augeas-devel at redhat.com
> Subject: Re: Inconsistent matching of multiple predicates (involving last/position)
> 
> On 28/08/15 09:50, Mol, Xavier (SCC) wrote:
> > What Augeas version?
> > 	augeas-1.0.0-10.el6.x86_64
> 
> This is quite old, it appears to have been fixed some time since.
> 
> > augtool> defvar master /files/etc/auto.master
> > augtool> match $master/*[map]
> > /files/etc/auto.master/1 = /misc
> > /files/etc/auto.master/2 = /net
> > /files/etc/auto.master/3 = +
> > 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/*[map][last()]
> > /files/etc/auto.master/3 = +
> > augtool> match $master/*[map][position() = 2]
> > /files/etc/auto.master/2 = /net
> > augtool> match $master/*[label() != '#comment'][last()]
> >   (no matches)
> 
> On 1.4.0:
> 
> augtool> match $master/*[label() != '#comment'][last()]
> /files/etc/auto.master/3 = +
> 
> > augtool> match $master/*[label() != '#comment'][position() = 2]
> >   (no matches)
> 
> augtool> match $master/*[label() != '#comment'][position() = 3]
> /files/etc/auto.master/1 = /misc
> augtool> match $master/*[label() != '#comment'][position() = 6]
> /files/etc/auto.master/2 = /net
> 
> I'd guess position() is the position under the original node, not in the
> filtered results (!= '#comment').
> 
> A git bisect would probably narrow down which commit fixed it, as I
> can't remember now.  If you need it fixed in el6, please file a BZ with
> Red Hat.
> 
> --
> Dominic Cleal
> Red Hat Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6401 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20150828/01219a72/attachment.p7s>


More information about the augeas-devel mailing list