0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-04-01 02:49:15 +00:00

🔨 Apply signature.py help

This commit is contained in:
Scott Lahteine 2023-12-25 20:58:38 -06:00
parent dbf81f40de
commit 7603023928

View file

@ -8,6 +8,7 @@ import subprocess,re,json,hashlib
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
def enabled_defines(filepath):
''' '''
Return all enabled #define items from a given C header file in a dictionary. Return all enabled #define items from a given C header file in a dictionary.
A "#define" in a multi-line comment could produce a false positive if it's not A "#define" in a multi-line comment could produce a false positive if it's not
@ -33,7 +34,6 @@ better than what the config files say. You can then use the
a decent reflection of all enabled options that (probably) came from a decent reflection of all enabled options that (probably) came from
resulting config.ini to produce more exact configuration files. resulting config.ini to produce more exact configuration files.
''' '''
def enabled_defines(filepath):
outdict = {} outdict = {}
section = "user" section = "user"
spatt = re.compile(r".*@section +([-a-zA-Z0-9_\s]+)$") # must match @section ... spatt = re.compile(r".*@section +([-a-zA-Z0-9_\s]+)$") # must match @section ...
@ -74,12 +74,12 @@ def compress_file(filepath, storedname, outpath):
with zipfile.ZipFile(outpath, 'w', compression=zipfile.ZIP_BZIP2, compresslevel=9) as zipf: with zipfile.ZipFile(outpath, 'w', compression=zipfile.ZIP_BZIP2, compresslevel=9) as zipf:
zipf.write(filepath, arcname=storedname, compress_type=zipfile.ZIP_BZIP2, compresslevel=9) zipf.write(filepath, arcname=storedname, compress_type=zipfile.ZIP_BZIP2, compresslevel=9)
def compute_build_signature(env):
''' '''
Compute the build signature by extracting all configuration settings and Compute the build signature by extracting all configuration settings and
building a unique reversible signature that can be included in the binary. building a unique reversible signature that can be included in the binary.
The signature can be reversed to get a 1:1 equivalent configuration file. The signature can be reversed to get a 1:1 equivalent configuration file.
''' '''
def compute_build_signature(env):
if 'BUILD_SIGNATURE' in env: return if 'BUILD_SIGNATURE' in env: return
env.Append(BUILD_SIGNATURE=1) env.Append(BUILD_SIGNATURE=1)