* since 
https://git.openembedded.org/openembedded-core/diff/meta/classes/image-artifact-names.bbclass?id=abb0671d2cebfd7e8df94796404bbe9c7f961058
  which removed the
  bb.data.inherits_class('reproducible_build', d)
  condition this was already applied in all the builds which used DATETIME, so 
we
  can move it to the default value directly and DISTRO configs than can choose
  to use IMAGE_VERSION_SUFFIX_DATETIME as they want

[YOCTO #12937]

Signed-off-by: Martin Jansa <martin.ja...@gmail.com>
---
 meta/classes-global/base.bbclass                 |  3 +++
 meta/classes-recipe/image-artifact-names.bbclass | 12 +++---------
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index ac84312a87..755d10106a 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -207,6 +207,9 @@ do_unpack[postfuncs] += "create_source_date_epoch_stamp"
 
 def get_source_date_epoch_value(d):
     return oe.reproducible.epochfile_read(d.getVar('SDE_FILE'), d)
+def get_source_date_epoch_value_datetime(d):
+    import datetime
+    return 
datetime.datetime.fromtimestamp(int(get_source_date_epoch_value(d)), 
datetime.timezone.utc).strftime('%Y%m%d%H%M%S')
 
 def get_layers_branch_rev(d):
     revisions = oe.buildcfg.get_layer_revisions(d)
diff --git a/meta/classes-recipe/image-artifact-names.bbclass 
b/meta/classes-recipe/image-artifact-names.bbclass
index d0f1b0dc55..2d18f34c9c 100644
--- a/meta/classes-recipe/image-artifact-names.bbclass
+++ b/meta/classes-recipe/image-artifact-names.bbclass
@@ -9,8 +9,9 @@
 ##################################################################
 
 IMAGE_BASENAME ?= "${PN}"
-IMAGE_VERSION_SUFFIX ?= "-${PKGE}-${PKGV}-${PKGR}-${DATETIME}"
-IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME SOURCE_DATE_EPOCH"
+IMAGE_VERSION_SUFFIX_DATETIME = "${@get_source_date_epoch_value_datetime(d)}"
+IMAGE_VERSION_SUFFIX_DATETIME[vardepvalue] = ""
+IMAGE_VERSION_SUFFIX ?= 
"-${PKGE}-${PKGV}-${PKGR}-${IMAGE_VERSION_SUFFIX_DATETIME}"
 IMAGE_NAME ?= "${IMAGE_BASENAME}${IMAGE_MACHINE_SUFFIX}${IMAGE_NAME_SUFFIX}"
 IMAGE_LINK_NAME ?= "${IMAGE_NAME}${IMAGE_VERSION_SUFFIX}"
 
@@ -32,10 +33,3 @@ IMAGE_MACHINE_SUFFIX ??= "-${MACHINE}"
 # by default) followed by additional suffices which describe the format (.ext4,
 # .ext4.xz, etc.).
 IMAGE_NAME_SUFFIX ??= ".rootfs"
-
-python () {
-    if bb.data.inherits_class('deploy', d) and 
d.getVar("IMAGE_VERSION_SUFFIX") == "-${DATETIME}":
-        import datetime
-        d.setVar("IMAGE_VERSION_SUFFIX", "-" + 
datetime.datetime.fromtimestamp(int(d.getVar("SOURCE_DATE_EPOCH")), 
datetime.timezone.utc).strftime('%Y%m%d%H%M%S'))
-        d.setVarFlag("IMAGE_VERSION_SUFFIX", "vardepvalue", "")
-}
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#191086): 
https://lists.openembedded.org/g/openembedded-core/message/191086
Mute This Topic: https://lists.openembedded.org/mt/102747727/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to