All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Woronicz, Bartosz ( NSN - PL/Wroclaw)" <bartosz.woronicz@nokia.com>
To: "maciej.borzecki@open-rnd.pl" <maciej.borzecki@open-rnd.pl>,
	"yocto@yoctoproject.org" <yocto@yoctoproject.org>
Subject: Re: Where should I append Yocto bitbake task to create work folder symlink ?
Date: Thu, 4 Feb 2016 12:07:44 +0100	[thread overview]
Message-ID: <56B33100.9020903@nokia.com> (raw)
In-Reply-To: <1454497513.3990.6.camel@open-rnd.pl>

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.
>
>



  reply	other threads:[~2016-02-04 11:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 10:13 Where should I append Yocto bitbake task to create work folder symlink ? Woronicz, Bartosz ( NSN - PL/Wroclaw)
2016-02-03 10:28 ` Burton, Ross
2016-02-03 14:16   ` Woronicz, Bartosz ( NSN - PL/Wroclaw)
2016-02-03 15:40     ` Burton, Ross
2016-02-04 11:03       ` Woronicz, Bartosz ( NSN - PL/Wroclaw)
2016-02-03 11:05 ` Maciek Borzecki
2016-02-04 11:07   ` Woronicz, Bartosz ( NSN - PL/Wroclaw) [this message]
2016-02-08 13:20     ` Woronicz, Bartosz ( NSN - PL/Wroclaw)
2016-02-08 13:44       ` Maciek Borzecki
2016-02-09  8:37         ` Woronicz, Bartosz ( NSN - PL/Wroclaw)
2016-02-09  9:10           ` Burton, Ross
2016-02-09 13:51             ` Woronicz, Bartosz ( NSN - PL/Wroclaw)
2016-02-09 13:56               ` Burton, Ross
2016-02-10 14:00                 ` Woronicz, Bartosz ( NSN - PL/Wroclaw)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B33100.9020903@nokia.com \
    --to=bartosz.woronicz@nokia.com \
    --cc=maciej.borzecki@open-rnd.pl \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.