2023-04-16 18:15:28 +00:00
|
|
|
From 0589a001f0207715e30e2bd9cb9f2edb39d53046 Mon Sep 17 00:00:00 2001
|
2022-10-22 19:17:54 +00:00
|
|
|
From: Luke Granger-Brown <git@lukegb.com>
|
|
|
|
Date: Sat, 22 Oct 2022 19:40:33 +0100
|
|
|
|
Subject: [PATCH 3/4] scripts/fbt/version: no git
|
|
|
|
|
|
|
|
---
|
|
|
|
scripts/fbt/version.py | 20 +++-----------------
|
|
|
|
1 file changed, 3 insertions(+), 17 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/scripts/fbt/version.py b/scripts/fbt/version.py
|
|
|
|
index e7fe2edaf..c07bc2915 100644
|
|
|
|
--- a/scripts/fbt/version.py
|
|
|
|
+++ b/scripts/fbt/version.py
|
|
|
|
@@ -1,30 +1,16 @@
|
|
|
|
-import subprocess
|
|
|
|
import datetime
|
|
|
|
from functools import cache
|
|
|
|
+import os
|
|
|
|
|
|
|
|
|
|
|
|
@cache
|
|
|
|
def get_git_commit_unix_timestamp():
|
|
|
|
- return int(subprocess.check_output(["git", "show", "-s", "--format=%ct"]))
|
|
|
|
+ return int(os.environ.get('SOURCE_DATE_EPOCH', 0))
|
|
|
|
|
|
|
|
|
|
|
|
@cache
|
|
|
|
def get_fast_git_version_id():
|
|
|
|
try:
|
|
|
|
- version = (
|
|
|
|
- subprocess.check_output(
|
|
|
|
- [
|
|
|
|
- "git",
|
|
|
|
- "describe",
|
|
|
|
- "--always",
|
|
|
|
- "--dirty",
|
|
|
|
- "--all",
|
|
|
|
- "--long",
|
|
|
|
- ]
|
|
|
|
- )
|
|
|
|
- .strip()
|
|
|
|
- .decode()
|
|
|
|
- )
|
|
|
|
- return (version, datetime.date.today())
|
|
|
|
+ return (str(get_git_commit_unix_timestamp()), datetime.date.today())
|
|
|
|
except Exception as e:
|
|
|
|
print("Failed to check for git changes", e)
|
|
|
|
--
|
2023-04-16 18:15:28 +00:00
|
|
|
2.39.2
|
2022-10-22 19:17:54 +00:00
|
|
|
|