[augeas-devel] Re: Difference between API's aug_match and augtool's match

Free Ekanayaka free at 64studio.com
Thu Sep 4 21:34:26 UTC 2008


Hi David,

|--==> On Thu, 04 Sep 2008 08:51:14 -0700, David Lutterkort <lutter at redhat.com> said:

  DL> On Thu, 2008-09-04 at 14:40 +0200, Free Ekanayaka wrote:
  >>Hi Raphaël,
  >>
  >>|--==> On Thu, 4 Sep 2008 14:29:36 +0200, "Raphaël Pinson" <raphink at gmail.com> said:
  >>
  >>[...]
  >>
  RP> In essence, the match command in augtool does first a aug_match call, and
  RP> then goes through the results and does an aug_get on each node and checks
  RP> that the value matches the given (optional) string (it would actually be
  RP> interesting if augtool accepted a regexp as a filter by the way).
  >>
  RP> This cannot be added to the API without modifying the API, which is not
  RP> acceptable, so you'd have to either rewrite what cmd_match does in your
  RP> program, or make a new API call (e.g. aug_match_filter) that would do this.
  >>
  >>I think such a new API call would be very useful.

  DL> If I ever get to actually implementing the XPath-like extensions I want
  DL> to implement, you'll get the same (and more) from aug_match by using a
  DL> path expression like '/foo/bar/baz[value() = "myvalue"]'

That would be a huge step forward indeed.

Ciao,

Free




More information about the augeas-devel mailing list