On Thu, Jun 28, 2018 at 7:34 PM Peter Kjellerstedt <peter.kjellerst...@axis.com> wrote: > > > -----Original Message----- > > From: Alex Kiernan [mailto:alex.kier...@gmail.com] > > Sent: den 28 juni 2018 17:57 > > To: kerg...@gmail.com > > Cc: richard.pur...@linuxfoundation.org; Peter Kjellerstedt > > <peter.kjellerst...@axis.com>; openembedded-core@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 <kerg...@gmail.com> > > wrote: > > > > > > On Thu, Jun 28, 2018 at 8:29 AM Richard Purdie > > <richard.pur...@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 >
That's true... I'll post an update -- Alex Kiernan -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core