From: Daan De Meyer Date: Wed, 9 Apr 2025 13:00:28 +0000 (+0200) Subject: elf2efi: Deal properly with empty $SOURCE_DATE_EPOCH X-Git-Tag: v258-rc1~858^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6a29eee2be6ec8ef1473b8097f6d0a2b9e09f4b;p=thirdparty%2Fsystemd.git elf2efi: Deal properly with empty $SOURCE_DATE_EPOCH --- diff --git a/tools/elf2efi.py b/tools/elf2efi.py index cb1a284a601..a63d3fc98da 100755 --- a/tools/elf2efi.py +++ b/tools/elf2efi.py @@ -611,7 +611,7 @@ def elf2efi(args: argparse.Namespace): coff.Machine = pe_arch coff.NumberOfSections = len(sections) - coff.TimeDateStamp = int(os.environ.get("SOURCE_DATE_EPOCH", time.time())) + coff.TimeDateStamp = int(sde if (sde := os.environ.get("SOURCE_DATE_EPOCH")) else time.time()) coff.SizeOfOptionalHeader = sizeof(opt) # EXECUTABLE_IMAGE|LINE_NUMS_STRIPPED|LOCAL_SYMS_STRIPPED|DEBUG_STRIPPED # and (32BIT_MACHINE or LARGE_ADDRESS_AWARE)