[augeas-devel] saving edited files in another directory

David Lutterkort lutter at redhat.com
Wed May 12 17:26:13 UTC 2010


On Wed, 2010-05-12 at 05:54 -0400, Christopher Harvey wrote:
> What if I don't have root permissions, but want to get a diff anyway? My
> first thought was to have augeas save into /tmp/foo but I can't figure out
> how to do it. I read the docs but no mention of this feature. I could write
> a patch myself if this is an interesting feature and it doesn't already
> exist.

You are right - there's no way to tell Augeas to save into a different
dir than the one from which it read the initial files. Adding a 'save
as ..' feature will require a little care, since Augeas has to read the
original file again during save.

One simple way out of this is to change the root directory for Augeas
when you start it, i.e. copy the files you are interested in to some
other directory (e.g., 'cp /etc/hosts /tmp/myroot/etc/hosts') and then
tell Augeas about that new root e.g. with 'augtool -r /tmp/myroot'

David





More information about the augeas-devel mailing list