Hi All,
I have re-written the existing Python program "augprint.py" in C.
I've called the new tool "augsuggest", and it is currently available from:
https://github.com/georgehansper/augsuggest.c
Like augprint.py, augsuggest creates an augtool script for a given file.
The resulting script is intended to
- be able to recreate the original file
- make no changes if applied to the original file
- use path-expressions in preference to position-numbers
The resulting script requires Augeas version 1.13.0 to work properly,
but the output can still be a useful starting point when used with
earlier versions of Augeas.
For example, given a file /etc/hosts with the contents:
127.0.0.1 localhost localhost.localdomain localhost4
augsuggest will produce the following output:
set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/ipaddr '127.0.0.1'
set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/canonical 'localhost'
set
/files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost.localdomain']
'localhost.localdomain'
set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost4']
'localhost4'
This output can be used to create idempotent augtool scripts with little
or no further editing when used with Augeas 1.13.0 or later.
For further details, see: https://github.com/georgehansper/augsuggest.c
Regards,
George Hansper
_______________________________________________
augeas-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/augeas-devel