poudriere's check_leftovers and update-mime-database

From: Luca Pizzamiglio <pizzamig_at_freebsd.org>
Date: Mon, 01 Nov 2021 15:32:47 UTC
Hi all,

Recently I've encountered an issue (a race condition?) with poudriere and a
port I maintain with MIME database.

The bulk build in poudriere, with the -t flag to enable check_leftovers, is
failing because the mime database wasn't updated when the package is
But, in reality, update-mime-database just takes a few seconds
(asynchronously) to unregister the application.

When deinstalling the port on my local machine, I notice that I have to
wait a couple of seconds to see the MIME files fully updated.
I brutally hacked poudriere adding a `sleep 3` in the check_leftovers()
function and the bulk build succeeded.

Have you experienced this before?
Am I the only one with this problem?

Best regards,