]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Allow RPM to return total file sizes larger than 4GB
authorNils Hanke <nils.hanke@outlook.com>
Mon, 13 Feb 2023 17:59:55 +0000 (18:59 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 14 Feb 2023 15:31:09 +0000 (16:31 +0100)
When an RPM has a total content size over 4GB, the --qf parameter
needs to use LONGSIZE instead of SIZE to display the total package
content file size, likely to keep compatibility with code
expecting 32 bit friendly values.

Otherwise, if a package is larger than 4GB, RPM returns (none).
Since this is later given as input to Python's int(),
it will throw an exception due to (none) not being a number.

mkosi/manifest.py

index 1d0c1e2f80f8c74ff2485a522c03cac1fd5013c7..6ade9c99cc2752884f7bcb832267d2a0e4eb844a 100644 (file)
@@ -106,7 +106,7 @@ class Manifest:
 
         c = run(
             ["rpm", f"--root={root}", f"--dbpath={dbpath}", "-qa", "--qf",
-             r"%{NEVRA}\t%{SOURCERPM}\t%{NAME}\t%{ARCH}\t%{SIZE}\t%{INSTALLTIME}\n"],
+             r"%{NEVRA}\t%{SOURCERPM}\t%{NAME}\t%{ARCH}\t%{LONGSIZE}\t%{INSTALLTIME}\n"],
             stdout=PIPE,
             text=True,
         )