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
Fix stack corruption when calling VerifyEnvironmentsPromise().
(cherry picked from commit c9de9e82273eff22be85d3be547c1b10c5fbf3c2)
Merge pull request #1013 from kacfengine/3.5.x

[3.5.x] Fix stack corruption when calling VerifyEnvironmentsPromise().
Remove global PROMISETIME
fix for bug #3517 HPUX hosts truncate the hostname to eight characters

modification of utsname functionality #1
Merge pull request #1016 from McAtte/hpux-fix-hostname-3.5.x

fix for bug #3517 HPUX hosts truncate the hostname to eight characters
 fix windows build failure by defining _SYS_NMLN
Merge pull request #1019 from McAtte/hpux-fix-hostname-3.5.x

 fix windows build failure by defining _SYS_NMLN
Fix compile error because of missing libpromises dependencies.
Merge pull request #1020 from kacfengine/3.5.x

Fix compile error because of missing libpromises dependencies.
Fix strftime unit test.

The test tests/acceptance/01_vars/02_functions/strftime.cf would fail
builds on Sundays. The policy specified Sunday as 7 but strftime specifies
Sunday as 0.

From strftime(3):

     %w    is replaced by the weekday (Sunday as the first day of the week)
           as a decimal number (0-6).
(cherry picked from commit 4d6b69fbd2f421725b7f1308b15190c7b933c7fe)
Merge pull request #1029 from kacfengine/3.5.x

[3.5.x] Fix strftime unit test.