fetch2: add .lz compression support

See http://www.nongnu.org/lzip/lzip.html for details on the compression
format.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
utils.py: don't use len() for truth value testing.

Signed-off-by: Oscar Utbult <oscar@oscr.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
prserv: don't wait until exit to sync

In the commit 'prserv: Ensure data is committed', the PR server moved to
only committing transactions to the database when the PR server is
stopped.  This improves performance, but it means that if the machine
running the PR server loses power unexpectedly or if the PR server
process gets SIGKILL, the uncommitted package revision data is lost.

To fix this issue, sync the database periodically, once per 30 seconds
by default, if it has been marked as dirty.  To be safe, continue to
sync the database at exit regardless of its status.

Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>