Skip to content

Commit

Permalink
Merge pull request #293 from freddy36/processhtml
Browse files Browse the repository at this point in the history
Keep original mtime for gzip compressed files, avoiding uneccesary Web.o rebuilds
  • Loading branch information
tueddy authored Jan 30, 2024
2 parents 721032c + 0e60ba8 commit 4e92977
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion processHtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,11 @@ def _process_binary_file(cls, binary_path, header_path, info):
with binary_path.open(mode="r", encoding="utf-8") as f:
content = f.read()

# get status of the file (copy modified time to gzip header)
stinfo = os.stat(binary_path)

# compress content
data = gzip.compress(content.encode())
data = gzip.compress(content.encode(), mtime=stinfo.st_mtime)

with header_path.open(mode="a", encoding="utf-8") as header_file:
varName = binary_path.name.split('.')[0]
Expand Down

0 comments on commit 4e92977

Please sign in to comment.