mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-29 19:24:25 +03:00
Use SOURCE_DATE_EPOCH for timestamp if present
The Debian reproducible builds effort suggests using this environment variable for timestamps.
This commit is contained in:
18
cmake/formatdate.py
Executable file
18
cmake/formatdate.py
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import sys
|
||||
import datetime
|
||||
|
||||
def usage():
|
||||
print("Usage:", os.path.basename(sys.argv[0]), "<seconds from epoch>")
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
usage()
|
||||
sys.exit(1)
|
||||
|
||||
ts = sys.argv[1]
|
||||
|
||||
build_date = datetime.datetime.utcfromtimestamp(int(ts))
|
||||
|
||||
print(build_date.strftime("%Y-%m-%d"))
|
Reference in New Issue
Block a user