blob: acb7e38f10acaa0f0a7476f207be35837a1cf91b [file] [log] [blame]
From 30fb5a6b774ba0e2fac1f04631e320a03b9da206 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Wed, 4 Oct 2023 17:03:52 +0800
Subject: [PATCH] use current epoch date for version
---
include/toplevel.mk | 16 ++++++++++------
scripts/get_cur_epoch.sh | 7 +++++++
2 files changed, 17 insertions(+), 6 deletions(-)
create mode 100755 scripts/get_cur_epoch.sh
diff --git a/include/toplevel.mk b/include/toplevel.mk
index 744695b..48fb5b4 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -8,12 +8,16 @@ export IS_TTY=$(shell tty -s && echo 1 || echo 0)
include $(TOPDIR)/include/verbose.mk
-ifeq ($(SDK),1)
- include $(TOPDIR)/include/version.mk
-else
- REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
- SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
-endif
+# ifeq ($(SDK),1)
+# include $(TOPDIR)/include/version.mk
+# else
+# REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
+# SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
+# endif
+
+# change to use the current epoch
+REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
+SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_cur_epoch.sh)
export REVISION
export SOURCE_DATE_EPOCH
diff --git a/scripts/get_cur_epoch.sh b/scripts/get_cur_epoch.sh
new file mode 100755
index 0000000..33b732c
--- /dev/null
+++ b/scripts/get_cur_epoch.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+export LANG=C
+export LC_ALL=C
+[ -n "$TOPDIR" ] && cd $TOPDIR
+
+REV="$(date -u -d "$datetime" +"%s")"
+echo "$REV"
--
2.39.2