aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-05-29 11:18:02 -0700
committerTao Bao <tbao@google.com>2018-05-29 15:34:08 -0700
commit48bbb1ba67a9faee85f26dd359eae2f83d778ff0 (patch)
tree6c92d16841a58b6ec7251256e0f2d64b0837b230
parent014d1fc9692aee8eecb95379452cc1dbe846c44b (diff)
downloadbuild-48bbb1ba67a9faee85f26dd359eae2f83d778ff0.tar.gz
Expose PLATFORM_SECURITY_PATCH_TIMESTAMP.
We have use case that uses the timestamp for PLATFORM_SECURITY_PATCH in device specific Makefile, but need to handle the platform-dependent `date` command. This CL computes and exposes PLATFORM_SECURITY_PATCH_TIMESTAMP from the core build system. Bug: 80311893 Test: Use PLATFORM_SECURITY_PATCH_TIMESTAMP in device-specific folder, on both of Linux and macOS. Check the value. Change-Id: I27a88dcebde7a1c204491f5f5c45c5160398dbb6 Merged-In: I27a88dcebde7a1c204491f5f5c45c5160398dbb6 (cherry picked from commit 717d9d3ae2d2e8d000dad0eb0454658678b79f2f)
-rw-r--r--core/version_defaults.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/version_defaults.mk b/core/version_defaults.mk
index 8841b6b954..43f3f024e5 100644
--- a/core/version_defaults.mk
+++ b/core/version_defaults.mk
@@ -234,6 +234,16 @@ ifndef PLATFORM_SECURITY_PATCH
PLATFORM_SECURITY_PATCH := 2018-06-05
endif
+ifndef PLATFORM_SECURITY_PATCH_TIMESTAMP
+ # Used to indicate the matching timestamp for the security patch string in PLATFORM_SECURITY_PATCH.
+ ifneq (,$(findstring Darwin,$(UNAME)))
+ PLATFORM_SECURITY_PATCH_TIMESTAMP := $(shell date -jf '%Y-%m-%d %T %Z' '$(PLATFORM_SECURITY_PATCH) 00:00:00 GMT' +%s)
+ else
+ PLATFORM_SECURITY_PATCH_TIMESTAMP := $(shell date -d 'TZ="GMT" $(PLATFORM_SECURITY_PATCH)' +%s)
+ endif
+endif
+.KATI_READONLY := PLATFORM_SECURITY_PATCH_TIMESTAMP
+
ifndef PLATFORM_BASE_OS
# Used to indicate the base os applied to the device.
# Can be an arbitrary string, but must be a single word.