2024-03-02 11:41:07 +00:00
|
|
|
From 36a893def13dfdf41da9da4ef259402173e5141e Mon Sep 17 00:00:00 2001
|
2022-10-22 19:17:54 +00:00
|
|
|
From: Luke Granger-Brown <git@lukegb.com>
|
2024-03-02 11:41:07 +00:00
|
|
|
Date: Sat, 2 Mar 2024 00:05:39 +0000
|
2023-07-19 02:54:50 +00:00
|
|
|
Subject: [PATCH 3/5] scripts/fbt/version: no git
|
2022-10-22 19:17:54 +00:00
|
|
|
|
|
|
|
---
|
2023-05-05 23:42:06 +00:00
|
|
|
scripts/fbt/version.py | 19 +++----------------
|
|
|
|
1 file changed, 3 insertions(+), 16 deletions(-)
|
2022-10-22 19:17:54 +00:00
|
|
|
|
|
|
|
diff --git a/scripts/fbt/version.py b/scripts/fbt/version.py
|
2023-05-05 23:42:06 +00:00
|
|
|
index 09f48c8eb..e76bd1bc8 100644
|
2022-10-22 19:17:54 +00:00
|
|
|
--- a/scripts/fbt/version.py
|
|
|
|
+++ b/scripts/fbt/version.py
|
2023-05-05 23:42:06 +00:00
|
|
|
@@ -1,30 +1,17 @@
|
2022-10-22 19:17:54 +00:00
|
|
|
import datetime
|
2023-05-05 23:42:06 +00:00
|
|
|
import subprocess
|
2022-10-22 19:17:54 +00:00
|
|
|
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)
|
|
|
|
--
|
2024-03-02 11:41:07 +00:00
|
|
|
2.43.0
|
2022-10-22 19:17:54 +00:00
|
|
|
|