[oe-commits] [openembedded-core] 03/13: image: Use ${COREBASE}/meta for timestamp, fallback to bitbake.conf

git at git.openembedded.org git at git.openembedded.org
Wed Aug 15 14:34:43 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit ed103640f23159548ddc8b218bbed858b53e53bb
Author: Alex Kiernan <alex.kiernan at gmail.com>
AuthorDate: Fri Jul 20 04:33:17 2018 +0000

    image: Use ${COREBASE}/meta for timestamp, fallback to bitbake.conf
    
    To handle the case where ${COREBASE} isn't the git directory, avoid
    erroring out when the git command fails. If we don't have a timestamp
    after this, fall back to the timestamp from conf/bitbake.conf.
    
    Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/image.bbclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index c0a2714..5ae0910 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -650,7 +650,10 @@ POPULATE_SDK_PRE_TARGET_COMMAND += "${@bb.utils.contains('DISTRO_FEATURES', 'usr
 reproducible_final_image_task () {
     if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
         if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
-            REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct`
+            REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 --pretty=%ct 2>/dev/null` || true
+            if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" = "" ]; then
+                REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`
+            fi
         fi
         # Set mtime of all files to a reproducible value
         bbnote "reproducible_final_image_task: mtime set to $REPRODUCIBLE_TIMESTAMP_ROOTFS"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list