Patchwork [RFC] package ipk bbclass: store build branch and revision in ipkg metadata

login
register
mail settings
Submitter Koen Kooi
Date Aug. 30, 2011, 8:58 a.m.
Message ID <1314694703-22310-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/10749/
State New, archived
Headers show

Comments

Koen Kooi - Aug. 30, 2011, 8:58 a.m.
The ipkg metadata will look like this now:

    koen@dominion:/OE/angstrom-dev/deploy/glibc$ dpkg-deb -I ipk/am3517-evm/matrix-gui_1.3-r19.0.6_am3517-evm.ipk
     new debian package, version 2.0.
     size 24112 bytes: control archive= 540 bytes.
         629 bytes,    13 lines      control
     Package: matrix-gui
     Version: 1.3-r19.0.6
     Description: Matrix GUI for Qt X11
     Section: multimedia
     Priority: optional
     Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
     License: BSD
     Architecture: am3517-evm
     OE: matrix-gui
     Homepage: https://gforge.ti.com/gf/project/matrix_gui/
     Build: org.openembedded.dev/f35ab2d
     Depends: matrix-gui-common, libpng12-0, libfreetype6, libz1, libgthread-2.0-0, libqtwebkit4, libphonon4, libqtdbus4, libqtxml4, libqtgui4, libqtnetwork4, libqtcore4, libglib-2.0-0, libc6, libstdc++6, libgcc1
     Source: svn://gforge.ti.com/svn/matrix_gui/;module=trunk;proto=https;user=anonymous;pswd=''
    koen@dominion:/OE/angstrom-dev/deploy/glibc$

    Signed-off-by: Koen Kooi <koen@openembedded.org>
    Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
    Acked-by: Chase Maupin <chase.maupin@ti.com>

[Ported from .dev/6ae45bbf2b5ca9e4fd7e8b04e461f0bf120dd44d]
---
 meta/classes/package_ipk.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Richard Purdie - Aug. 30, 2011, 9:21 a.m.
On Tue, 2011-08-30 at 10:58 +0200, Koen Kooi wrote:
> The ipkg metadata will look like this now:
> 
>     koen@dominion:/OE/angstrom-dev/deploy/glibc$ dpkg-deb -I ipk/am3517-evm/matrix-gui_1.3-r19.0.6_am3517-evm.ipk
>      new debian package, version 2.0.
>      size 24112 bytes: control archive= 540 bytes.
>          629 bytes,    13 lines      control
>      Package: matrix-gui
>      Version: 1.3-r19.0.6
>      Description: Matrix GUI for Qt X11
>      Section: multimedia
>      Priority: optional
>      Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
>      License: BSD
>      Architecture: am3517-evm
>      OE: matrix-gui
>      Homepage: https://gforge.ti.com/gf/project/matrix_gui/
>      Build: org.openembedded.dev/f35ab2d
>      Depends: matrix-gui-common, libpng12-0, libfreetype6, libz1, libgthread-2.0-0, libqtwebkit4, libphonon4, libqtdbus4, libqtxml4, libqtgui4, libqtnetwork4, libqtcore4, libglib-2.0-0, libc6, libstdc++6, libgcc1
>      Source: svn://gforge.ti.com/svn/matrix_gui/;module=trunk;proto=https;user=anonymous;pswd=''
>     koen@dominion:/OE/angstrom-dev/deploy/glibc$
> 
>     Signed-off-by: Koen Kooi <koen@openembedded.org>
>     Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
>     Acked-by: Chase Maupin <chase.maupin@ti.com>
> 
> [Ported from .dev/6ae45bbf2b5ca9e4fd7e8b04e461f0bf120dd44d]
> ---
>  meta/classes/package_ipk.bbclass |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
> index e83aff8..63d7f18 100644
> --- a/meta/classes/package_ipk.bbclass
> +++ b/meta/classes/package_ipk.bbclass
> @@ -303,6 +303,7 @@ python do_package_ipk () {
>  		fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
>  		fields.append(["OE: %s\n", ['PN']])
>  		fields.append(["Homepage: %s\n", ['HOMEPAGE']])
> +		fields.append(["Build: %s/%s\n", ['METADATA_BRANCH', 'METADATA_REVISION']])
>  
>  		def pullData(l, d):
>  			l2 = []

How does this cope with our multiple branches and revisions for
different layers? I worry about this being confusing :/

Cheers,

Richard
Koen Kooi - Aug. 30, 2011, 10:31 a.m.
Op 30 aug. 2011, om 11:21 heeft Richard Purdie het volgende geschreven:

> On Tue, 2011-08-30 at 10:58 +0200, Koen Kooi wrote:
>> The ipkg metadata will look like this now:
>> 
>>    koen@dominion:/OE/angstrom-dev/deploy/glibc$ dpkg-deb -I ipk/am3517-evm/matrix-gui_1.3-r19.0.6_am3517-evm.ipk
>>     new debian package, version 2.0.
>>     size 24112 bytes: control archive= 540 bytes.
>>         629 bytes,    13 lines      control
>>     Package: matrix-gui
>>     Version: 1.3-r19.0.6
>>     Description: Matrix GUI for Qt X11
>>     Section: multimedia
>>     Priority: optional
>>     Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
>>     License: BSD
>>     Architecture: am3517-evm
>>     OE: matrix-gui
>>     Homepage: https://gforge.ti.com/gf/project/matrix_gui/
>>     Build: org.openembedded.dev/f35ab2d
>>     Depends: matrix-gui-common, libpng12-0, libfreetype6, libz1, libgthread-2.0-0, libqtwebkit4, libphonon4, libqtdbus4, libqtxml4, libqtgui4, libqtnetwork4, libqtcore4, libglib-2.0-0, libc6, libstdc++6, libgcc1
>>     Source: svn://gforge.ti.com/svn/matrix_gui/;module=trunk;proto=https;user=anonymous;pswd=''
>>    koen@dominion:/OE/angstrom-dev/deploy/glibc$
>> 
>>    Signed-off-by: Koen Kooi <koen@openembedded.org>
>>    Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
>>    Acked-by: Chase Maupin <chase.maupin@ti.com>
>> 
>> [Ported from .dev/6ae45bbf2b5ca9e4fd7e8b04e461f0bf120dd44d]
>> ---
>> meta/classes/package_ipk.bbclass |    1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>> 
>> diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
>> index e83aff8..63d7f18 100644
>> --- a/meta/classes/package_ipk.bbclass
>> +++ b/meta/classes/package_ipk.bbclass
>> @@ -303,6 +303,7 @@ python do_package_ipk () {
>> 		fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
>> 		fields.append(["OE: %s\n", ['PN']])
>> 		fields.append(["Homepage: %s\n", ['HOMEPAGE']])
>> +		fields.append(["Build: %s/%s\n", ['METADATA_BRANCH', 'METADATA_REVISION']])
>> 
>> 		def pullData(l, d):
>> 			l2 = []
> 
> How does this cope with our multiple branches and revisions for
> different layers? I worry about this being confusing :/

As I said to Paul in a different thread on angstrom-devel, it's up to OE-core to make those variables (more) usefull. Personally I'm happy with the current patch since it gives me a starting point, but long term I'd like metadata_scm.bbclass to represent the layers better in the METADATA_* vars.

regards,

Koen
Koen Kooi - Aug. 31, 2011, 11:01 a.m.
Op 30 aug. 2011, om 11:21 heeft Richard Purdie het volgende geschreven:

> On Tue, 2011-08-30 at 10:58 +0200, Koen Kooi wrote:
>> The ipkg metadata will look like this now:
>> 
>>    koen@dominion:/OE/angstrom-dev/deploy/glibc$ dpkg-deb -I ipk/am3517-evm/matrix-gui_1.3-r19.0.6_am3517-evm.ipk
>>     new debian package, version 2.0.
>>     size 24112 bytes: control archive= 540 bytes.
>>         629 bytes,    13 lines      control
>>     Package: matrix-gui
>>     Version: 1.3-r19.0.6
>>     Description: Matrix GUI for Qt X11
>>     Section: multimedia
>>     Priority: optional
>>     Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
>>     License: BSD
>>     Architecture: am3517-evm
>>     OE: matrix-gui
>>     Homepage: https://gforge.ti.com/gf/project/matrix_gui/
>>     Build: org.openembedded.dev/f35ab2d
>>     Depends: matrix-gui-common, libpng12-0, libfreetype6, libz1, libgthread-2.0-0, libqtwebkit4, libphonon4, libqtdbus4, libqtxml4, libqtgui4, libqtnetwork4, libqtcore4, libglib-2.0-0, libc6, libstdc++6, libgcc1
>>     Source: svn://gforge.ti.com/svn/matrix_gui/;module=trunk;proto=https;user=anonymous;pswd=''
>>    koen@dominion:/OE/angstrom-dev/deploy/glibc$
>> 
>>    Signed-off-by: Koen Kooi <koen@openembedded.org>
>>    Acked-by: Martin Jansa <Martin.Jansa@gmail.com>
>>    Acked-by: Chase Maupin <chase.maupin@ti.com>
>> 
>> [Ported from .dev/6ae45bbf2b5ca9e4fd7e8b04e461f0bf120dd44d]
>> ---
>> meta/classes/package_ipk.bbclass |    1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>> 
>> diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
>> index e83aff8..63d7f18 100644
>> --- a/meta/classes/package_ipk.bbclass
>> +++ b/meta/classes/package_ipk.bbclass
>> @@ -303,6 +303,7 @@ python do_package_ipk () {
>> 		fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
>> 		fields.append(["OE: %s\n", ['PN']])
>> 		fields.append(["Homepage: %s\n", ['HOMEPAGE']])
>> +		fields.append(["Build: %s/%s\n", ['METADATA_BRANCH', 'METADATA_REVISION']])
>> 
>> 		def pullData(l, d):
>> 			l2 = []
> 
> How does this cope with our multiple branches and revisions for
> different layers? I worry about this being confusing :/

So you're looking for volunteers to turn

        layers = (data.getVar("BBLAYERS", e.data, 1) or "").split()
        layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
            base_get_metadata_git_branch(i, None).strip(), \
            base_get_metadata_git_revision(i, None)) \
                for i in layers]
        i = len(layers_branch_rev)-1
        p1 = layers_branch_rev[i].find("=")
        s1= layers_branch_rev[i][p1:]
        while i > 0:
            p2 = layers_branch_rev[i-1].find("=")
            s2= layers_branch_rev[i-1][p2:]
            if s1 == s2:
                layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
                i -= 1
            else:
                i -= 1
                p1 = layers_branch_rev[i].find("=")
                s1= layers_branch_rev[i][p1:]

into something valid for dpkg and rpm fields, right? If so, any volunteers?

regards,

Koen

Patch

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index e83aff8..63d7f18 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -303,6 +303,7 @@  python do_package_ipk () {
 		fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
 		fields.append(["OE: %s\n", ['PN']])
 		fields.append(["Homepage: %s\n", ['HOMEPAGE']])
+		fields.append(["Build: %s/%s\n", ['METADATA_BRANCH', 'METADATA_REVISION']])
 
 		def pullData(l, d):
 			l2 = []