mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-03-19 17:42:22 +00:00
Allow custom man build date via SOURCE_DATE_EPOCH (#2096)
Allows making man1/conky.1 in builds reproducible. See https://reproducible-builds.org/ for why this is good and https://reproducible-builds.org/specs/source-date-epoch/ for the definition of this variable. Also use UTC to be independent of timezone.
This commit is contained in:
parent
15024a0095
commit
1a8e49d9ba
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
import yaml
|
import yaml
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
@ -16,12 +17,16 @@ with open(os.path.join(base_path, "variables.yaml")) as file:
|
|||||||
with open(os.path.join(base_path, "lua.yaml")) as file:
|
with open(os.path.join(base_path, "lua.yaml")) as file:
|
||||||
lua = yaml.safe_load(file)
|
lua = yaml.safe_load(file)
|
||||||
|
|
||||||
|
build_date = datetime.datetime.fromtimestamp(
|
||||||
|
int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
|
||||||
|
tz=datetime.timezone.utc,
|
||||||
|
)
|
||||||
data = {
|
data = {
|
||||||
"config_settings": config_settings,
|
"config_settings": config_settings,
|
||||||
"variables": variables,
|
"variables": variables,
|
||||||
"lua": lua,
|
"lua": lua,
|
||||||
"date": datetime.date.today().isoformat(),
|
"date": build_date.date().isoformat(),
|
||||||
"copyright_year": datetime.date.today().year,
|
"copyright_year": build_date.year,
|
||||||
}
|
}
|
||||||
|
|
||||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||||
|
Loading…
x
Reference in New Issue
Block a user