elf2efi: Deal properly with empty $SOURCE_DATE_EPOCH

This commit is contained in:
Daan De Meyer
2025-04-09 15:00:28 +02:00
parent b2634bde3c
commit d6a29eee2b

View File

@@ -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)