in_position? method wasn't working right due to issues with using following-sibling when before and preceding-sibling when after, this corrects it with new, hopefully proper assumptions. The only item that small change didn't fix was last() which was not working for either because of the way siblings treat the last() command as it will always resolve to true on the first match in those cases. This patch assumes that you'll never have more than one [last()] in your xpath for positioning and swaps it out with the correct final array value of augeas matches. We use an invert boolean on 'after' positions as we will always have an empty? resolving as true if the match exists before the item we're looking for. Whereas we'll always have empty? as false if we do a 'before' and the actual item currently exists after the line we're trying to match.
-- I still need to complete the unit tests for this. But this should be a working solution unless some side effects or conflicts can be presented.
this is a patch in reference to https://github.com/hercules-team/augeasproviders_pam/issues/10
modulesync 5.4.0