Openembedded Core Discussions
 help / color / mirror / Atom feed
* why would a recipe have both do_install() and do_install_append()?
@ 2012-07-04  2:22 Robert P. J. Day
  2012-07-04  6:32 ` Khem Raj
  0 siblings, 1 reply; 9+ messages in thread
From: Robert P. J. Day @ 2012-07-04  2:22 UTC (permalink / raw)
  To: OE Core mailing list


  i'm probably just misreading something, but what is the point of a
recipe having both a do_install() and do_install_append() function?
for example, here's part of e2fsprogs_1.42.1.bb:

do_install () {
        oe_runmake 'DESTDIR=${D}' install
        oe_runmake 'DESTDIR=${D}' install-libs
        # We use blkid from util-linux now so remove from here
        rm -f ${D}${base_libdir}/libblkid*
        rm -rf ${D}${includedir}/blkid
        rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
}

do_install_append () {
        # e2initrd_helper and the pkgconfig files belong in libdir
        if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
                install -d ${D}${libdir}
                mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
                mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
        fi
}

  how does that differ from simply defining a single do_install()
routine?  i'm willing for this to be a dumb question.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-04  2:22 why would a recipe have both do_install() and do_install_append()? Robert P. J. Day
@ 2012-07-04  6:32 ` Khem Raj
  2012-07-04 10:04   ` Andreas Oberritter
  0 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2012-07-04  6:32 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Tue, Jul 3, 2012 at 7:22 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
>   i'm probably just misreading something, but what is the point of a
> recipe having both a do_install() and do_install_append() function?
> for example, here's part of e2fsprogs_1.42.1.bb:
>
> do_install () {
>         oe_runmake 'DESTDIR=${D}' install
>         oe_runmake 'DESTDIR=${D}' install-libs
>         # We use blkid from util-linux now so remove from here
>         rm -f ${D}${base_libdir}/libblkid*
>         rm -rf ${D}${includedir}/blkid
>         rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
> }
>
> do_install_append () {
>         # e2initrd_helper and the pkgconfig files belong in libdir
>         if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
>                 install -d ${D}${libdir}
>                 mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
>                 mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
>         fi
> }
>
>   how does that differ from simply defining a single do_install()
> routine?  i'm willing for this to be a dumb question.

it does not. I think it could be arguably done in same do_install
but it does have some logical separation where the append operation is
moving files from /lib to /usr/lib

in theory another use of it is that you can override do_install_append
in a .bbappend file
and still reuse the do_install. Suppose you do not want to move the
files and are
happy with default location
>
> rday
>
> --
>
> ========================================================================
> Robert P. J. Day                                 Ottawa, Ontario, CANADA
>                         http://crashcourse.ca
>
> Twitter:                                       http://twitter.com/rpjday
> LinkedIn:                               http://ca.linkedin.com/in/rpjday
> ========================================================================
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-04  6:32 ` Khem Raj
@ 2012-07-04 10:04   ` Andreas Oberritter
  2012-07-04 10:16     ` Robert P. J. Day
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Oberritter @ 2012-07-04 10:04 UTC (permalink / raw)
  To: openembedded-core

On 04.07.2012 08:32, Khem Raj wrote:
> On Tue, Jul 3, 2012 at 7:22 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>>
>>   i'm probably just misreading something, but what is the point of a
>> recipe having both a do_install() and do_install_append() function?
>> for example, here's part of e2fsprogs_1.42.1.bb:
>>
>> do_install () {
>>         oe_runmake 'DESTDIR=${D}' install
>>         oe_runmake 'DESTDIR=${D}' install-libs
>>         # We use blkid from util-linux now so remove from here
>>         rm -f ${D}${base_libdir}/libblkid*
>>         rm -rf ${D}${includedir}/blkid
>>         rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
>> }
>>
>> do_install_append () {
>>         # e2initrd_helper and the pkgconfig files belong in libdir
>>         if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
>>                 install -d ${D}${libdir}
>>                 mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
>>                 mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
>>         fi
>> }
>>
>>   how does that differ from simply defining a single do_install()
>> routine?  i'm willing for this to be a dumb question.
> 
> it does not. I think it could be arguably done in same do_install

Yes.

> but it does have some logical separation where the append operation is
> moving files from /lib to /usr/lib

It would be better to just use a comment and/or empty line for logical
separation.

> in theory another use of it is that you can override do_install_append
> in a .bbappend file
> and still reuse the do_install.

AFAICT, you can't override an append. Both appends, the original and the
bbappended, would get executed.

Regards,
Andreas



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-04 10:04   ` Andreas Oberritter
@ 2012-07-04 10:16     ` Robert P. J. Day
  2012-07-04 11:29       ` Richard Purdie
  0 siblings, 1 reply; 9+ messages in thread
From: Robert P. J. Day @ 2012-07-04 10:16 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Wed, 4 Jul 2012, Andreas Oberritter wrote:

> On 04.07.2012 08:32, Khem Raj wrote:
> > On Tue, Jul 3, 2012 at 7:22 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >>
> >>   i'm probably just misreading something, but what is the point of a
> >> recipe having both a do_install() and do_install_append() function?
> >> for example, here's part of e2fsprogs_1.42.1.bb:
> >>
> >> do_install () {
> >>         oe_runmake 'DESTDIR=${D}' install
> >>         oe_runmake 'DESTDIR=${D}' install-libs
> >>         # We use blkid from util-linux now so remove from here
> >>         rm -f ${D}${base_libdir}/libblkid*
> >>         rm -rf ${D}${includedir}/blkid
> >>         rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
> >> }
> >>
> >> do_install_append () {
> >>         # e2initrd_helper and the pkgconfig files belong in libdir
> >>         if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
> >>                 install -d ${D}${libdir}
> >>                 mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
> >>                 mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
> >>         fi
> >> }
> >>
> >>   how does that differ from simply defining a single do_install()
> >> routine?  i'm willing for this to be a dumb question.
> >
> > it does not. I think it could be arguably done in same do_install
>
> Yes.
>
> > but it does have some logical separation where the append operation is
> > moving files from /lib to /usr/lib
>
> It would be better to just use a comment and/or empty line for logical
> separation.
>
> > in theory another use of it is that you can override do_install_append
> > in a .bbappend file
> > and still reuse the do_install.
>
> AFAICT, you can't override an append. Both appends, the original and the
> bbappended, would get executed.

  ok, now i *definitely* want to know whether this would work or not
since there are a few recipes that define both do_install() and
do_install_append().

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-04 10:16     ` Robert P. J. Day
@ 2012-07-04 11:29       ` Richard Purdie
  2012-07-05  5:39         ` Khem Raj
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2012-07-04 11:29 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Wed, 2012-07-04 at 06:16 -0400, Robert P. J. Day wrote:
> On Wed, 4 Jul 2012, Andreas Oberritter wrote:
> 
> > On 04.07.2012 08:32, Khem Raj wrote:
> > > On Tue, Jul 3, 2012 at 7:22 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > >>
> > >>   i'm probably just misreading something, but what is the point of a
> > >> recipe having both a do_install() and do_install_append() function?
> > >> for example, here's part of e2fsprogs_1.42.1.bb:
> > >>
> > >> do_install () {
> > >>         oe_runmake 'DESTDIR=${D}' install
> > >>         oe_runmake 'DESTDIR=${D}' install-libs
> > >>         # We use blkid from util-linux now so remove from here
> > >>         rm -f ${D}${base_libdir}/libblkid*
> > >>         rm -rf ${D}${includedir}/blkid
> > >>         rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
> > >> }
> > >>
> > >> do_install_append () {
> > >>         # e2initrd_helper and the pkgconfig files belong in libdir
> > >>         if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
> > >>                 install -d ${D}${libdir}
> > >>                 mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
> > >>                 mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
> > >>         fi
> > >> }
> > >>
> > >>   how does that differ from simply defining a single do_install()
> > >> routine?  i'm willing for this to be a dumb question.
> > >
> > > it does not. I think it could be arguably done in same do_install
> >
> > Yes.
> >
> > > but it does have some logical separation where the append operation is
> > > moving files from /lib to /usr/lib
> >
> > It would be better to just use a comment and/or empty line for logical
> > separation.
> >
> > > in theory another use of it is that you can override do_install_append
> > > in a .bbappend file
> > > and still reuse the do_install.
> >
> > AFAICT, you can't override an append. Both appends, the original and the
> > bbappended, would get executed.
> 
>   ok, now i *definitely* want to know whether this would work or not
> since there are a few recipes that define both do_install() and
> do_install_append().

Andreas is correct, you can't override a do_install_append (), both
would just get appended.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-04 11:29       ` Richard Purdie
@ 2012-07-05  5:39         ` Khem Raj
  2012-07-05 10:14           ` Robert P. J. Day
  0 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2012-07-05  5:39 UTC (permalink / raw)
  To: openembedded-core

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 7/4/2012 4:29 AM, Richard Purdie wrote:
>>>>> AFAICT, you can't override an append. Both appends, the
>>>>> original and the bbappended, would get executed.
>>> 
>>> ok, now i *definitely* want to know whether this would work or
>>> not since there are a few recipes that define both do_install()
>>> and do_install_append().
> Andreas is correct, you can't override a do_install_append (),
> both would just get appended.

yes thats true. I was thinking about having appends which are
recipe-class specific but that case wont apply to a normal _append
like above

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/1KJwACgkQuwUzVZGdMxQ/PgCgj9Vi3iWwvf6qbxyrx942pfYu
A0UAoIvvGdvFeQI8i6oc524N50Sn/ltR
=Iz3L
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-05  5:39         ` Khem Raj
@ 2012-07-05 10:14           ` Robert P. J. Day
  2012-07-05 17:32             ` Scott Garman
  0 siblings, 1 reply; 9+ messages in thread
From: Robert P. J. Day @ 2012-07-05 10:14 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Wed, 4 Jul 2012, Khem Raj wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 7/4/2012 4:29 AM, Richard Purdie wrote:
> >>>>> AFAICT, you can't override an append. Both appends, the
> >>>>> original and the bbappended, would get executed.
> >>>
> >>> ok, now i *definitely* want to know whether this would work or
> >>> not since there are a few recipes that define both do_install()
> >>> and do_install_append().
> > Andreas is correct, you can't override a do_install_append (),
> > both would just get appended.
>
> yes thats true. I was thinking about having appends which are
> recipe-class specific but that case wont apply to a normal _append
> like above

  so, in the end. there's really no compelling rationale for a recipe
defining both a do_install() and do_install_append() back to back, is
that correct?  because there are a small number of OE recipes that do
just that:

$ grep -wl do_install $(grep -rlw do_install_append *)
meta/recipes-support/libcap/libcap.inc
meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.1.bb
meta/recipes-core/tinylogin/tinylogin_1.4.bb
meta/recipes-core/eglibc/eglibc-package.inc
meta/recipes-kernel/linux/linux-yocto.inc
meta/recipes-extended/lsb/lsb_1.4.bb
meta/recipes-extended/man/man_1.6f.bb
meta/recipes-extended/logrotate/logrotate_3.8.1.bb
$

  obviously, it doesn't hurt, it just seems unnecessary.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-05 10:14           ` Robert P. J. Day
@ 2012-07-05 17:32             ` Scott Garman
  2012-07-09 10:08               ` Andrei Gherzan
  0 siblings, 1 reply; 9+ messages in thread
From: Scott Garman @ 2012-07-05 17:32 UTC (permalink / raw)
  To: openembedded-core

On 07/05/2012 03:14 AM, Robert P. J. Day wrote:
> On Wed, 4 Jul 2012, Khem Raj wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 7/4/2012 4:29 AM, Richard Purdie wrote:
>>>>>>> AFAICT, you can't override an append. Both appends, the
>>>>>>> original and the bbappended, would get executed.
>>>>>
>>>>> ok, now i *definitely* want to know whether this would work or
>>>>> not since there are a few recipes that define both do_install()
>>>>> and do_install_append().
>>> Andreas is correct, you can't override a do_install_append (),
>>> both would just get appended.
>>
>> yes thats true. I was thinking about having appends which are
>> recipe-class specific but that case wont apply to a normal _append
>> like above
>
>    so, in the end. there's really no compelling rationale for a recipe
> defining both a do_install() and do_install_append() back to back, is
> that correct?  because there are a small number of OE recipes that do
> just that:
>
> $ grep -wl do_install $(grep -rlw do_install_append *)
> meta/recipes-support/libcap/libcap.inc
> meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.1.bb
> meta/recipes-core/tinylogin/tinylogin_1.4.bb
> meta/recipes-core/eglibc/eglibc-package.inc
> meta/recipes-kernel/linux/linux-yocto.inc
> meta/recipes-extended/lsb/lsb_1.4.bb
> meta/recipes-extended/man/man_1.6f.bb
> meta/recipes-extended/logrotate/logrotate_3.8.1.bb
> $
>
>    obviously, it doesn't hurt, it just seems unnecessary.

I wrote the do_install_append() in e2fsprogs, and it was no doubt due to 
the fact that I was moving libraries around in a number of recipes, and 
wanted to logically separate this operation into the _append step in a 
consistent manner. It was just a mindset I was in, and as you point out, 
it wasn't necessary, nor did it do much harm.

Scott

-- 
Scott Garman
Embedded Linux Engineer - Yocto Project
Intel Open Source Technology Center





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why would a recipe have both do_install() and do_install_append()?
  2012-07-05 17:32             ` Scott Garman
@ 2012-07-09 10:08               ` Andrei Gherzan
  0 siblings, 0 replies; 9+ messages in thread
From: Andrei Gherzan @ 2012-07-09 10:08 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]

On Thu, Jul 5, 2012 at 8:32 PM, Scott Garman <scott.a.garman@intel.com>wrote:

> On 07/05/2012 03:14 AM, Robert P. J. Day wrote:
>
>> On Wed, 4 Jul 2012, Khem Raj wrote:
>>
>>  -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> On 7/4/2012 4:29 AM, Richard Purdie wrote:
>>>
>>>>  AFAICT, you can't override an append. Both appends, the
>>>>>>>> original and the bbappended, would get executed.
>>>>>>>>
>>>>>>>
>>>>>> ok, now i *definitely* want to know whether this would work or
>>>>>> not since there are a few recipes that define both do_install()
>>>>>> and do_install_append().
>>>>>>
>>>>> Andreas is correct, you can't override a do_install_append (),
>>>> both would just get appended.
>>>>
>>>
>>> yes thats true. I was thinking about having appends which are
>>> recipe-class specific but that case wont apply to a normal _append
>>> like above
>>>
>>
>>    so, in the end. there's really no compelling rationale for a recipe
>> defining both a do_install() and do_install_append() back to back, is
>> that correct?  because there are a small number of OE recipes that do
>> just that:
>>
>> $ grep -wl do_install $(grep -rlw do_install_append *)
>> meta/recipes-support/libcap/**libcap.inc
>> meta/recipes-devtools/**e2fsprogs/e2fsprogs_1.42.1.bb
>> meta/recipes-core/tinylogin/ti**nylogin_1.4.bb <http://tinylogin_1.4.bb>
>> meta/recipes-core/eglibc/**eglibc-package.inc
>> meta/recipes-kernel/linux/**linux-yocto.inc
>> meta/recipes-extended/lsb/lsb_**1.4.bb <http://lsb_1.4.bb>
>> meta/recipes-extended/man/man_**1.6f.bb <http://man_1.6f.bb>
>> meta/recipes-extended/**logrotate/logrotate_3.8.1.bb
>> $
>>
>>    obviously, it doesn't hurt, it just seems unnecessary.
>>
>
> I wrote the do_install_append() in e2fsprogs, and it was no doubt due to
> the fact that I was moving libraries around in a number of recipes, and
> wanted to logically separate this operation into the _append step in a
> consistent manner. It was just a mindset I was in, and as you point out, it
> wasn't necessary, nor did it do much harm.
>
>
In my opinion this behavior makes sense for stuff that are
just temporary pulled in / aka workarounds.

@g

[-- Attachment #2: Type: text/html, Size: 3596 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-07-09 10:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-04  2:22 why would a recipe have both do_install() and do_install_append()? Robert P. J. Day
2012-07-04  6:32 ` Khem Raj
2012-07-04 10:04   ` Andreas Oberritter
2012-07-04 10:16     ` Robert P. J. Day
2012-07-04 11:29       ` Richard Purdie
2012-07-05  5:39         ` Khem Raj
2012-07-05 10:14           ` Robert P. J. Day
2012-07-05 17:32             ` Scott Garman
2012-07-09 10:08               ` Andrei Gherzan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox