[augeas-devel] Latest yum.aug make check fail

Francis Giraldeau francis.giraldeau at usherbrooke.ca
Sat Aug 21 22:33:40 UTC 2010


Hi, 

It seems that the commit 620ee4 is causing failure of unit tests. 

A new list keyword has been added to handle the case where gnupg key is
a list. The first error I found is the list_sep that doesn't accept
simple space between values: 

-  let list_sep = del /[ \t]*(,[ \t]*|\n[ \t]+)/ "\n\t"
+  let list_sep = del /([ \t]*(,[ \t]*|\n[ \t]+))|[ \t]+/ "\n\t"

The lens accept sections with one of either "baseurl" or "gpgkey", and
an error occur when they are both present, as in
tests/etc/yum.repos.d/remi.repo. The "lists" lens can't be iterated,
because a iteration in put direction occur. So, I added every possible
combinations of entries and lists: 

  let section =
    let list_baseurl = kv_list "baseurl" in
      let list_gpgkey = kv_list "gpgkey" in  
    [ sechead . (  entry* 
                 | entry* . list_baseurl . entry* 
                 | entry* . list_gpgkey . entry* 
                 | entry* . list_baseurl . entry* . list_gpgkey . entry*
                 | entry* . list_gpgkey . entry* . list_baseurl .
entry*)]

It's ugly, but it prevent to change the tree structure, and preserve the
behavior that reject the config if more than one baseurl option is
present. 

We can do it because there are only two options. Adding a third special
keyword this way will create huge lens, to list every combinations: 

x | 
xax | xbx | xcx |
xaxbx | xaxcx | xbxax | xbxcx | xcxax | xcxbx |
xaxbxcx | xaxcxbx | xbxaxcx | xbxcxax | xcxaxbx | xcxbxax

options | alternatives
----------------------
1       | 2 
2       | 5
3       | 16


Anyway, here is the little patch to fix the isue. 

Francis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-yum-tests.patch
Type: text/x-patch
Size: 6167 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20100821/d50500e1/attachment.bin>


More information about the augeas-devel mailing list