]> git.ipfire.org Git - thirdparty/mkosi.git/commit
Drop microsecond resolution for datetime.now()
authorAlberto Planas <aplanas@suse.com>
Wed, 6 Aug 2025 10:58:55 +0000 (12:58 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 7 Aug 2025 11:06:50 +0000 (12:06 +0100)
commitec3fe915323f1b8ddefb73e583f983b31a78ed18
tree08977f085433cb6dc4ee4765a215831e13337f60
parent9f7a53b687ee2f1304d94fc7ac09211facad6683
Drop microsecond resolution for datetime.now()

The RPM INSTALLTIME attribute is an integer represetantion of the
installation time of the package, and datetime.now is a date
representation of a float timestamp.  This can produce some rounding
errors is powerful build servers.

For example, if the variable `_init_timestamp` has a value XXXXX.1 but
in the same sub-second the package gets installed, the registered
installation time will be the integer representation (XXXXX), making the
comparison done for exclusion of the package to be `True`.

This patch will remove the microsecond granularity of the datetime,
converting the timestamp on its integer representation, instead of the
default float one.  The comparison is still done in the datetime data
type.

Signed-off-by: Alberto Planas <aplanas@suse.com>
mkosi/manifest.py