[augeas-devel] Lens aptsource cannot save new entry
David Lutterkort
lutter at redhat.com
Fri Jul 1 23:21:54 UTC 2011
Hi
sorry for the vacation-induced delay. If you haven't figured it out yet,
here's some hints:
On Sat, 2011-06-18 at 16:02 +0200, Niklaus Giger wrote:
> > sudo augtool
> > augtool> ins last()+1 after /files/etc/apt/sources.list/*[last()]
This creates a node with the label 'last()+1' - the first argument to
ins is taken verbatim. Since the entries in sources.list are numbered 1,
2, 3, etc. you should insert new ones as 01, 02, etc.
> > augtool> set /files/etc/apt/sources.list/*[last()]/distribution
> > experimental augtool> set /files/etc/apt/sources.list/*[last()]/type deb
> > augtool> set /files/etc/apt/sources.list/*[last()]/component main
> > augtool> set /files/etc/apt/sources.list/*[last()]/uri"
> > http://mirror.switch.ch/ftp/mirror/debian/neu
There's a couple problems here: (1) the entries are not in the necessary
order (order matters with Augeas' tree) (2) you have an extra '"' after
uri.
You can always get more information about errors with
'print /augeas//error' - if that prints nothing, there were no errors.
These commands do what you want them to do:
ins 01 after /files/etc/apt/sources.list/*[last()]
set /files/etc/apt/sources.list/*[last()]/type deb
set /files/etc/apt/sources.list/*[last()]/uri "http://mirror.switch.ch/ftp/mirror/debian/neu"
set /files/etc/apt/sources.list/*[last()]/distribution experimental
set /files/etc/apt/sources.list/*[last()]/component main
print /files/etc/apt/sources.list/*[last()]
save
print /augeas//error
David
More information about the augeas-devel
mailing list