]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix manifest creation when running on Bionic
authorLuca Boccassi <bluca@debian.org>
Fri, 5 Aug 2022 22:08:14 +0000 (23:08 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 6 Aug 2022 11:18:12 +0000 (13:18 +0200)
Very old dpkg doesn't have the db-fsys:Last-Modified field
so it errors out. Skip creating manifests for sysext when
building on such old distros. Only affects Bionic right now.

Fixes https://github.com/systemd/mkosi/issues/1105

mkosi/manifest.py

index 07e07ae2115c034d45df34d33492f5c7c7a0a87c..0892266df23ea0312e78a2060e6397d0457bbee6 100644 (file)
@@ -148,8 +148,11 @@ class Manifest:
             name, source, version, arch, size, installtime = package.split("\t")
 
             # dpkg records the size in KBs, the field is optional
+            # db-fsys:Last-Modified is not available in very old dpkg, so just skip creating
+            # the manifest for sysext when building on very old distributions by setting the
+            # timestamp to epoch. This only affects Ubuntu Bionic which is nearing EOL.
             size = int(size) * 1024 if size else 0
-            installtime = datetime.fromtimestamp(int(installtime))
+            installtime = datetime.fromtimestamp(int(installtime) if installtime else 0)
 
             # If we are creating a layer based on a BaseImage=, e.g. a sysext, filter by
             # packages that were installed in this execution of mkosi. We assume that the