On Fri, Apr 6, 2012 at 07:10, Dominic Cleal <[email protected]> wrote: > On 04/04/12 23:44, Greg Swift wrote: >> On Wed, Apr 4, 2012 at 15:32, Dominic Cleal <[email protected]> wrote: >>> On 04/04/12 14:14, Greg Swift wrote: >>>> I'm also slightly confused by the fact that these two expressions >>>> seems to overlap, but augeas doesn't complain, and if I change the ws >>>> one to not use a *, it blows up. >>>> >>>> let indent = del /^[ \t]+/ " " >>>> let ws = del /[ \t]*/ " " >>> >>> These two don't seem to be used in combination with each other - they're >>> just defined side by side. The only error I can generate by changing >>> "ws" to require a space is where it's used for lists of entries to >>> permit whitespace next to square brackets. I don't think you want to >>> change this, only "indent". >> >> well my concern was that the two regex expressions should match >> similar data. and was suprised it wasn't breaking. When I changed >> the * in ws to a + i was unable to load /etc/cobbler/settings. >> >> [root@infra1-rep network-scripts]# augtool >> augtool> ls /files/etc/cobbler/settings >> augtool> print /augeas/files/etc/cobbler/settings/error >> /augeas/files/etc/cobbler/settings/error = "parse_failed" >> /augeas/files/etc/cobbler/settings/error/pos = "2974" >> /augeas/files/etc/cobbler/settings/error/line = "69" > > The "ws" lens is only used in this context: > let lbr = del /\[/ "[" > let rbr = del /\]/ "]" > let setting_list_suffix = [label "sequence" . lbr . ws . > (value_list . ws)? . rbr ] . eol > > It's used for lines such as this: > Setting_List:[Value1, Value2, Value3] > > If you change the regexp to /[ \t]+/ then the above line would be > invalid and you'd need to put spaces around the [ ] characters. I'm not > sure why you're trying to change this. > > There's no overlap between them because they're used in different > places. It'd only matter if they were in a union etc together.
That was my problem.... I was thinking of it in the wrong context. thanks for that >>> If you're working on a patch to tidy up and fix the indentation, that >>> would be great. I hadn't realised we had this lens which implemented >>> plain YAML, it would be nice to complete and copy it to become a generic >>> YAML lens (to sit with other lenses such as XML, JSON etc). I think >>> some parts such as the [] lists are Cobbler extensions. >> >> Seems to me like this is a much more useful direction, although I >> don't know that myself or the cobbler guys are up to the task of >> implementing a YAML lens. > > I think a general YAML lens is something for us to pick up and include > upstream. kewl. >>> As mentioned on IRC, it would be nice to have Cobbler adopt the lenses >>> as part of their source tree. There are some projects (libvirt, >>> corosync) that ship their own lenses, so this one could equally >>> "graduate" into Cobbler itself if they'd like it - preventing lag in >>> changes and fixes. >> >> That may be very doable. although the 'getting there is an >> interesting concept to me, although I guess they can do a required >> augeas-libs >= version. > > If it was included in Cobbler then their packages could install it to > /usr/share/augeas/lenses which would override any older/broken lens > shipped by Augeas in /usr/share/augeas/lenses/dist. We would still have to require a version of augeas that didn't provide the lense, because we can't provide a file that augeas-libs provides in our RPM. > If it was only fixed in Augeas then yes, a dependency on the new version > could be done, but you won't get new versions of Augeas lenses in > existing distro releases (the oldest ship version 0.7.2). Yes, which is why we should handle our own, but still doesn't fix the race condition of providing a file that is already in existence. _______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
