Whoa,

That's great! However I modified it, so the link will be relative

The problem is that it works until you have sstate cache empty, because after that it doesn't fetch and unpack when already have it in

do_latest_link() {
        if [ -n "${WORKDIR}" ]; then
                linkname="$(basename $(dirname ${WORKDIR}))/latest"
                rm -f $linkname
                ln -s ${WORKDIR} $linkname
        fi
}
addtask latest_link after do_unpack


Kind regards,
Bartosz Woronicz
Engineer, Software Configuration (SCM)
NSN - PL/Wroclaw

On 03.02.2016 12:05, EXT Maciek Borzecki wrote:
On śro, 2016-02-03 at 11:13 +0100, Woronicz, Bartosz ( NSN - PL/Wroclaw) wrote:
Let's say I have my package at

      host-64/tmp/work/x86_64-poky-linux/mypackage/1.2.3-r4/

I would like to have symlink created

      host-64/tmp/work/x86_64-poky-linux/mypackage/latest -> 1.2.3-r4/

each time the new version is fetched and unpacked. How can I achieve
that ? Which class, task should I append, extend ?

Optionally, I would like to have that for all packages or at least
packages in my meta.


P.S. I asked the same question here:
http://stackoverflow.com/questions/35158764/where-should-i-append-yocto-bitbake-task-to-
create-work-folder-symlink

Put that into a class in your layer, ex. latest-link.bbclass (untested):

do_latest_link() {
        if [ -n "${WORKDIR}" ]; then
                linkname="$(dirname ${WORKDIR})/latest"
                rm -f $linkname
                ln -s ${WORKDIR} $linkname
        fi
}
addtask latest_link after do_unpack


If you want that applied to all the recipes then add INHERIT += "latest-link" 
in your
local.conf. The other way is just to 'inherit latest-link' in individual 
recipes.



--
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to