cfengine/masterfiles — pull request #232 by kacfengine (2014-05-06 13:46:29+00:00)
Title: Redmine #5627: Fix two misparsings of "yum check-update" output.

Issue 1: The regex incorrectly assumed that the package name cannot
contain '.', which it can (java-1.6.0 is the name, the version comes
later). However, this makes the output format ambiguous, so switch to
spaces for separating the fields in the "rpm --qf" command.

Issue 2: "yum check-update" breaks up its output according to a 80-
column width when piping to a process. This means that an entry can
span up to three lines, one for each name-arch/version/repo. Fixed by
postprocessing the yum output in sed.

It requires a lot of effort to provoke the line-breaking yum output in
a test environment, so I opted for the slightly less foolproof method
of storing the output in a file and testing our parsing expression
with a dummy package body. This required some changes to the package
bodies in order to share this expression, but it also makes it more
centralized.