[OE-core] [OE-Core][PATCH 1/2] image: Set COREBASE as the git directory for timestamp
Peter Kjellerstedt
peter.kjellerstedt at axis.com
Thu Jun 28 18:34:04 UTC 2018
> -----Original Message-----
> From: Alex Kiernan [mailto:alex.kiernan at gmail.com]
> Sent: den 28 juni 2018 17:57
> To: kergoth at gmail.com
> Cc: richard.purdie at linuxfoundation.org; Peter Kjellerstedt
> <peter.kjellerstedt at axis.com>; openembedded-core at lists.openembedded.org
> Subject: Re: [OE-core] [OE-Core][PATCH 1/2] image: Set COREBASE as the
> git directory for timestamp
>
> On Thu, Jun 28, 2018 at 4:31 PM Christopher Larson <kergoth at gmail.com>
> wrote:
> >
> > On Thu, Jun 28, 2018 at 8:29 AM Richard Purdie
> <richard.purdie at linuxfoundation.org> wrote:
> >>
> >> On Thu, 2018-06-28 at 15:18 +0000, Peter Kjellerstedt wrote:
> >> > There is no guarantee that ${COREBASE} refers to a path that is
> >> > under Git control. E.g., in our case it refers to a directory that
> >> > is under repo control. "${COREBASE}/meta" is probably a better
> >> > option.
> >>
> >> You could make that argument about /meta too.
> >>
> >> I'd suggest the code checks for ${COREBASE}/.git and if that doesn't
>
> In a poky checkout from repo (which is what I'm also using),
> ${COREBASE}/meta/.git doesn't exist, but ${COREBASE}/.git does, but
> that all works because it's climbing the directory tree to find the
> .git directory.
>
> >> exist, fall back to the timestamp of the
> >> ${COREBASE}/meta/conf/bitbake.conf file.
> >
> > That's a good idea, but I'd suggest using bb.utils.which() to locate
> > conf/bibake.conf rather than hardcoding that path.
>
> How about (totally untested):
>
> if git -C "${COREBASE}/meta" rev-parse --show-toplevel; then
> REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}/meta" log -1 --pretty=%ct`
> else
> REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y ${@bb.utils.which(bbpath, "conf/bitbake.conf")}`
> fi
>
> ?
You do not really need the first git call above:
REPRODUCIBLE_TIMESTAMP_ROOTFS=$(git -C "${COREBASE}/meta" log -1 --pretty=%ct 2>/dev/null)
if [ -z "$REPRODUCIBLE_TIMESTAMP_ROOTFS" ]; then
REPRODUCIBLE_TIMESTAMP_ROOTFS=$(stat -c%Y ${@bb.utils.which(bbpath, "conf/bitbake.conf")})
fi
> --
> Alex Kiernan
//Peter
More information about the Openembedded-core
mailing list