[augeas-devel] Is this a bug in Augeas?

Richard W.M. Jones rjones at redhat.com
Tue Jun 5 10:43:50 UTC 2018


On Mon, Jun 04, 2018 at 11:30:52AM -0700, David Lutterkort wrote:
> I've opened a PR (https://github.com/hercules-team/augeas/pull/562) with a
> modified Grub lens that is more tolerant of these kinds of errors. Lines
> like the 'acpi=off' in your example will now be mapped into the tree as
> '#error' nodes, rather than refusing to parse such a file outright. Let me
> know if that does what you need it to do, or if it needs to be changed
> further.

I tried to test this, but I couldn't get augtool to do anything when
run from the local tree.

After patching my git copy of augeas with the patch above and
compiling it, augtool could never load any files:

  $ PATH=`pwd`/src:$PATH LENS_DIR=`pwd`/lenses augtool -r /var/tmp/root/
  augtool> ls /files
  [nothing]

Even without the -r parameter it did nothing.

In libvirt & libguestfs we generate a ‘./run’ script in the top build
directory which sets up the environment right so you could do
something like:

  $ ./run augtool [...]

and have it just do the right thing.

Anyway if I understand the proposed patch from reading the source, it
wouldn't fail to parse the original file (which is progress) however
if we rewrote the file then any unparsable lines would be deleted, is
that correct?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the augeas-devel mailing list