[augeas-devel] saving edited files in another directory

Christopher Harvey chris at basementcode.com
Wed May 12 17:36:49 UTC 2010


On 05/12/10 13:26, David Lutterkort wrote:
> 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
> 

I want to write a patch that lets users get a diff between the original
and the modified without needing to be able to write to the directory
that contains the original. Is this an interesting feature? Could
somebody give me a general direction of how this should work internally
with Augeas?

Chris

-- 
My GnuPGP key at:
www.basementcode.com/public_key.txt




More information about the augeas-devel mailing list