blob: acb7e38f10acaa0f0a7476f207be35837a1cf91b [file] [log] [blame]
developer77ea8832023-10-04 17:06:48 +08001From 30fb5a6b774ba0e2fac1f04631e320a03b9da206 Mon Sep 17 00:00:00 2001
2From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Wed, 4 Oct 2023 17:03:52 +0800
4Subject: [PATCH] use current epoch date for version
5
6---
7 include/toplevel.mk | 16 ++++++++++------
8 scripts/get_cur_epoch.sh | 7 +++++++
9 2 files changed, 17 insertions(+), 6 deletions(-)
10 create mode 100755 scripts/get_cur_epoch.sh
11
12diff --git a/include/toplevel.mk b/include/toplevel.mk
13index 744695b..48fb5b4 100644
14--- a/include/toplevel.mk
15+++ b/include/toplevel.mk
16@@ -8,12 +8,16 @@ export IS_TTY=$(shell tty -s && echo 1 || echo 0)
17
18 include $(TOPDIR)/include/verbose.mk
19
20-ifeq ($(SDK),1)
21- include $(TOPDIR)/include/version.mk
22-else
23- REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
24- SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
25-endif
26+# ifeq ($(SDK),1)
27+# include $(TOPDIR)/include/version.mk
28+# else
29+# REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
30+# SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_source_date_epoch.sh)
31+# endif
32+
33+# change to use the current epoch
34+REVISION:=$(shell $(TOPDIR)/scripts/getver.sh)
35+SOURCE_DATE_EPOCH:=$(shell $(TOPDIR)/scripts/get_cur_epoch.sh)
36
37 export REVISION
38 export SOURCE_DATE_EPOCH
39diff --git a/scripts/get_cur_epoch.sh b/scripts/get_cur_epoch.sh
40new file mode 100755
41index 0000000..33b732c
42--- /dev/null
43+++ b/scripts/get_cur_epoch.sh
44@@ -0,0 +1,7 @@
45+#!/usr/bin/env bash
46+export LANG=C
47+export LC_ALL=C
48+[ -n "$TOPDIR" ] && cd $TOPDIR
49+
50+REV="$(date -u -d "$datetime" +"%s")"
51+echo "$REV"
52--
532.39.2
54