Fix assert setting sys variables for interfaces when none are detected
Fix null pointer reference in length() function.

It's legal for datatype_out to be NULL.
Varargs should be passed to vfprintf, no fprintf.
Change type from int to bool and Log() accordingly.
Removed redundant memset().
One variable should be enough for our tests.
Body file_select refers to directories as well.

But still ignore directories if depth_search is on, so that we recurse
into them.
Enable Pass/FAIL reporting using default_check_diff.
Added --no-clean switch to never delete workdir.
Fix memleak. Sanitize switch statement.
Make copy_from remote work with zero bytes files.

Also added a couple of unit tests.

Regression was caught by an assertion for size>0 in TLSRecv().
Merge pull request #1141 from kacfengine/length_func_null_ptr_bug

Fix null pointer reference in length() function.
new function: packagesmatching
cf-upgrade

cf-upgrade is a specialized tool for automatically upgrading CFEngine.
The architecture is explained in the README.md file inside the cf-upgrade
folder.
Merge pull request #834 from tzz/tzz/feature-packagesmatching

new function: packagesmatching
Merge pull request #1089 from cduclos/cf-update

cf-upgrade
Forgot to add Makefile.am
Fixing some problems in Makefile.am

- Removing CXXFLAGS
- _CPPFLAGS = CORE_CPPFLAGS
Merge pull request #1148 from cduclos/cf-update

Forgot to add Makefile.am
Fixing build on MinGW

- Windows has no concept of group permissions nor other permissions on
files, therefore the code needed to be adjusted.

- There is no fcntl(...) system call in Windows.

- fsync(...) does not exist in Windows.