Lots of fixes to package version comparisons and repository handling.

Too many fixes to count, but in general a lot of fixes on the sign of
comparisons (flipping less-than for greater-than, and vice versa), as
well as a lot of places where the comparison was reset wrongly.

Also made better verbose messages for package comparisons.

Fixes issue #3314, although a change to the update policy will still
be needed.
(cherry picked from commit 7c6e4939782aab1dbd57e7b7b52da839288e0b5d)

Conflicts:

	cf-agent/verify_packages.c
Fix leftover lessthan/greaterthan bug after 7c6e4939782.
(cherry picked from commit 01d07aeae1cffa9b0833479db31dfc66c642b6ce)
Fix wrong function signature.
(cherry picked from commit 9cfc0a956a4c4028ba82faff273c80f61b836e68)

Conflicts:

	cf-agent/verify_packages.h
	tests/unit/package_versions_compare_test.c
Fix package compare errors being ignored.

This would lead to package comparisons erronously being considered
true, when they were really errors. Interestingly, the test that
revealed this (07_packages/repositories.cf), only revealed the problem
when the its test files were in a certain order on disk, since that
influenced the comparison order.
(cherry picked from commit 00f1093047bde816d11a653fa2f35f49f9dfc7e8)

Conflicts:

	cf-agent/verify_packages.c
Avoid expansion overflow in successful comparisons.

If two files are identical, there is no reason to run the DEBUG
report commands. The 07_packages/repositories.cf test caused the
expansion to overflow even though the test itself was successful.
Fixing it by using an extra class to delay the execution until we
know the outcome.

This doesn't prevent the expansion from overflowing if the test fails,
but in that case it doesn't really matter.
(cherry picked from commit 70f90960ef00813c820d5d9ac1a9fbf5d878039c)

Conflicts:

	tests/acceptance/default.cf.sub
Fix function signature in 3.5.x.
Add missing tool for acceptance test.
Merge pull request #992 from kacfengine/3.5.x-backport-issue-3314

3.5.x backport issue 3314