All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Support additional user-defined package metadata
@ 2012-05-13 13:28 Leonid Borisenko
  2012-05-13 13:28 ` [PATCH 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Leonid Borisenko @ 2012-05-13 13:28 UTC (permalink / raw)
  To: openembedded-core

I'm an owner of Kindle Touch. It's basically a computer with ARM
Cortex-A8 based CPU and Linux. There is a [small] community of
enthuasists developing homebrew modifications for stock software. For
distributing of these modifications .ipk package format had been chosen
with OE as build infrastructure.

There are already several firmware versions for device and some more are
expected. Every firmware can introduce unpredictable changes, so
modifications for previous firmware versions could stop working.

Custom metadata field with supported firmware version(s) could be
included into package control file for preventing of installing packaged
modifications onto unsupported firmware.

But OE currently doesn't allow to define additional package metadata in
recipes. Patch fixes it.

There is already RPMSPEC_PREAMBLE variable used in package_rpm.bbclass.
I think, it is still useful for defining custom macros in header of spec
file (while additional user-defined metadata is placed somewhere between
common tags).

I didn't found any way to define newline character inside variable value
and it is needed to allow multiple [one-line] metadata fields/tags. So
I've used ability of OE to split list-typed variables (and re-joined
splitted value with real newline character).

The following changes since commit cab85fd0b481cdbf36477348de75352be3f38ca2:

  gdk-pixbuf: Drop unneeded RPROVIDES (2012-05-12 11:23:27 +0100)

up to 052d78ed7f986e76afb1ce6ef02e94ba1bbc9719:

  package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata (2012-05-13 14:51:26 +0300)

----------------------------------------------------------------
Leonid Borisenko (2):
      package.bbclass: add getter of additional metadata
      package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata

 meta/classes/package.bbclass     |   11 +++++++++++
 meta/classes/package_deb.bbclass |    5 +++++
 meta/classes/package_ipk.bbclass |    5 +++++
 meta/classes/package_rpm.bbclass |    7 +++++++
 4 files changed, 28 insertions(+)




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

* [PATCH 1/2] package.bbclass: add getter of additional metadata
  2012-05-13 13:28 [PATCH 0/3] Support additional user-defined package metadata Leonid Borisenko
@ 2012-05-13 13:28 ` Leonid Borisenko
  2012-05-13 13:28 ` [PATCH 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata Leonid Borisenko
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Leonid Borisenko @ 2012-05-13 13:28 UTC (permalink / raw)
  To: openembedded-core

Two variables are searched for value of additional package metadata:

  * PACKAGE_ADD_METADATA_<PKGTYPE>
  * PACKAGE_ADD_METADATA

First found variable with defined value wins.

<PKGTYPE> is a parameter of getter and expected to be a distinct name
of specific package type. For example: 'DEB' or 'RPM'.

Variable can contain multiple [one-line] metadata fields, separated by
literal sequence '\n'. Separator can be redefined through variable flag
'separator'. Getter returns found value with separator replaced with
newline character.

As side-effect, searched variables acquired flags 'type' (equals to
'list') and 'separator'.

Signed-off-by: Leonid Borisenko <ive.found@gmail.com>
---
 meta/classes/package.bbclass |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 99836e9..a40476c 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -326,6 +326,17 @@ def get_package_mapping (pkg, d):
 
 	return pkg
 
+def get_package_additional_metadata (pkg_type, d):
+	base_key = "PACKAGE_ADD_METADATA"
+	for key in ("%s_%s" % (base_key, pkg_type.upper()), base_key):
+		if d.getVar(key) is None:
+			continue
+		d.setVarFlag(key, "type", "list")
+		if d.getVarFlag(key, "separator") is None:
+			d.setVarFlag(key, "separator", "\\n")
+		metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
+		return "\n".join(metadata_fields).strip()
+
 def runtime_mapping_rename (varname, d):
 	#bb.note("%s before: %s" % (varname, d.getVar(varname, True)))	
 
-- 
1.7.10




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

* [PATCH 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata
  2012-05-13 13:28 [PATCH 0/3] Support additional user-defined package metadata Leonid Borisenko
  2012-05-13 13:28 ` [PATCH 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
@ 2012-05-13 13:28 ` Leonid Borisenko
  2012-05-18 18:34 ` [PATCH 0/3] Support additional user-defined package metadata Ive Found
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Leonid Borisenko @ 2012-05-13 13:28 UTC (permalink / raw)
  To: openembedded-core

Additional metadata from user-defined variable is written into
control/spec file of binary package.

Three variables are searched for adiitional package metadata:

  * PACKAGE_ADD_METADATA_<PKGTYPE>_<PN>
  * PACKAGE_ADD_METADATA_<PKGTYPE>
  * PACKAGE_ADD_METADATA

First found variable with defined value wins.

<PN> is a package name. <PKGTYPE> is a distinct name of specific
package type:

  * IPK for .ipk packages
  * DEB for .deb packages
  * RPM for .rpm packages

Variable can contain multiple [one-line] metadata fields separated by
literal sequence '\n'. Separator can be redefined through variable flag
'separator'. In package control/spec file separator is replaced by
newline character.

Signed-off-by: Leonid Borisenko <ive.found@gmail.com>
---
 meta/classes/package_deb.bbclass |    5 +++++
 meta/classes/package_ipk.bbclass |    5 +++++
 meta/classes/package_rpm.bbclass |    7 +++++++
 3 files changed, 17 insertions(+)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 4096fa2..7a45cec 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -330,6 +330,11 @@ python do_package_deb () {
             raise bb.build.FuncFailed("Missing field for deb generation: %s" % value)
         # more fields
 
+        custom_fields_chunk = get_package_additional_metadata("deb", localdata)
+        if custom_fields_chunk is not None:
+            ctrlfile.write(unicode(custom_fields_chunk))
+            ctrlfile.write("\n")
+
         mapping_rename_hook(localdata)
 
         rdepends = bb.utils.explode_dep_versions(localdata.getVar("RDEPENDS", True) or "")
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 73ec0ee..e3a8262 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -367,6 +367,11 @@ python do_package_ipk () {
 			raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value)
 		# more fields
 
+		custom_fields_chunk = get_package_additional_metadata("ipk", localdata)
+		if custom_fields_chunk is not None:
+			ctrlfile.write(custom_fields_chunk)
+			ctrlfile.write("\n")
+
 		mapping_rename_hook(localdata)
 
 		rdepends = bb.utils.explode_dep_versions(localdata.getVar("RDEPENDS", True) or "")
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 2da7a8b..799e5aa 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -638,6 +638,7 @@ python write_specfile () {
 	srcmaintainer  = d.getVar('MAINTAINER', True)
 	srchomepage    = d.getVar('HOMEPAGE', True)
 	srcdescription = d.getVar('DESCRIPTION', True) or "."
+	srccustomtagschunk = get_package_additional_metadata("rpm", d)
 
 	srcdepends     = strip_multilib(d.getVar('DEPENDS', True), d)
 	srcrdepends    = []
@@ -691,6 +692,7 @@ python write_specfile () {
 		splitlicense = (localdata.getVar('LICENSE', True) or "")
 		splitsection = (localdata.getVar('SECTION', True) or "")
 		splitdescription = (localdata.getVar('DESCRIPTION', True) or ".")
+		splitcustomtagschunk = get_package_additional_metadata("rpm", localdata)
 
 		translate_vers('RDEPENDS', localdata)
 		translate_vers('RRECOMMENDS', localdata)
@@ -759,6 +761,9 @@ python write_specfile () {
 			spec_preamble_bottom.append('License: %s' % splitlicense)
 		spec_preamble_bottom.append('Group: %s' % splitsection)
 
+		if srccustomtagschunk != splitcustomtagschunk:
+			spec_preamble_bottom.append(splitcustomtagschunk)
+
 		# Replaces == Obsoletes && Provides
 		if splitrreplaces and splitrreplaces.strip() != "":
 			for dep in splitrreplaces.split(','):
@@ -849,6 +854,8 @@ python write_specfile () {
 	spec_preamble_top.append('Group: %s' % srcsection)
 	spec_preamble_top.append('Packager: %s' % srcmaintainer)
 	spec_preamble_top.append('URL: %s' % srchomepage)
+	if srccustomtagschunk:
+		spec_preamble_top.append(srccustomtagschunk)
 	source_list = get_tarballs(d)
 	tail_source(d,source_list,None)
 
-- 
1.7.10




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

* Re: [PATCH 0/3] Support additional user-defined package metadata
  2012-05-13 13:28 [PATCH 0/3] Support additional user-defined package metadata Leonid Borisenko
  2012-05-13 13:28 ` [PATCH 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
  2012-05-13 13:28 ` [PATCH 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata Leonid Borisenko
@ 2012-05-18 18:34 ` Ive Found
  2012-05-28  6:40 ` [PING v2] [PATCH 0/2] " Ive Found
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Ive Found @ 2012-05-18 18:34 UTC (permalink / raw)
  To: openembedded-core

Ping. Any comments?

Btw, '[PATCH 0/3]' in subject is my accidental mistake. It shoud be
'[PATCH 0/2]'.

On Sun, May 13, 2012 at 4:28 PM, Leonid Borisenko <ive.found@gmail.com> wrote:
>
> I'm an owner of Kindle Touch. It's basically a computer with ARM
> Cortex-A8 based CPU and Linux. There is a [small] community of
> enthuasists developing homebrew modifications for stock software. For
> distributing of these modifications .ipk package format had been chosen
> with OE as build infrastructure.
>
> There are already several firmware versions for device and some more are
> expected. Every firmware can introduce unpredictable changes, so
> modifications for previous firmware versions could stop working.
>
> Custom metadata field with supported firmware version(s) could be
> included into package control file for preventing of installing packaged
> modifications onto unsupported firmware.
>
> But OE currently doesn't allow to define additional package metadata in
> recipes. Patch fixes it.
>
> There is already RPMSPEC_PREAMBLE variable used in package_rpm.bbclass.
> I think, it is still useful for defining custom macros in header of spec
> file (while additional user-defined metadata is placed somewhere between
> common tags).
>
> I didn't found any way to define newline character inside variable value
> and it is needed to allow multiple [one-line] metadata fields/tags. So
> I've used ability of OE to split list-typed variables (and re-joined
> splitted value with real newline character).
>
> The following changes since commit cab85fd0b481cdbf36477348de75352be3f38ca2:
>
>  gdk-pixbuf: Drop unneeded RPROVIDES (2012-05-12 11:23:27 +0100)
>
> up to 052d78ed7f986e76afb1ce6ef02e94ba1bbc9719:
>
>  package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata (2012-05-13 14:51:26 +0300)
>
> ----------------------------------------------------------------
> Leonid Borisenko (2):
>      package.bbclass: add getter of additional metadata
>      package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata
>
>  meta/classes/package.bbclass     |   11 +++++++++++
>  meta/classes/package_deb.bbclass |    5 +++++
>  meta/classes/package_ipk.bbclass |    5 +++++
>  meta/classes/package_rpm.bbclass |    7 +++++++
>  4 files changed, 28 insertions(+)
>



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

* [PING v2] [PATCH 0/2] Support additional user-defined package metadata
  2012-05-13 13:28 [PATCH 0/3] Support additional user-defined package metadata Leonid Borisenko
                   ` (2 preceding siblings ...)
  2012-05-18 18:34 ` [PATCH 0/3] Support additional user-defined package metadata Ive Found
@ 2012-05-28  6:40 ` Ive Found
  2012-05-28  9:44 ` [PATCH 0/3] " Phil Blundell
  2012-06-06  7:28 ` [PING v3] [PATCH 0/2] " Ive Found
  5 siblings, 0 replies; 14+ messages in thread
From: Ive Found @ 2012-05-28  6:40 UTC (permalink / raw)
  To: openembedded-core

Ping again. Any comments?

On Sun, May 13, 2012 at 4:28 PM, Leonid Borisenko <ive.found@gmail.com> wrote:
> I'm an owner of Kindle Touch. It's basically a computer with ARM
> Cortex-A8 based CPU and Linux. There is a [small] community of
> enthuasists developing homebrew modifications for stock software. For
> distributing of these modifications .ipk package format had been chosen
> with OE as build infrastructure.
>
> There are already several firmware versions for device and some more are
> expected. Every firmware can introduce unpredictable changes, so
> modifications for previous firmware versions could stop working.
>
> Custom metadata field with supported firmware version(s) could be
> included into package control file for preventing of installing packaged
> modifications onto unsupported firmware.
>
> But OE currently doesn't allow to define additional package metadata in
> recipes. Patch fixes it.
>
> There is already RPMSPEC_PREAMBLE variable used in package_rpm.bbclass.
> I think, it is still useful for defining custom macros in header of spec
> file (while additional user-defined metadata is placed somewhere between
> common tags).
>
> I didn't found any way to define newline character inside variable value
> and it is needed to allow multiple [one-line] metadata fields/tags. So
> I've used ability of OE to split list-typed variables (and re-joined
> splitted value with real newline character).
>
> The following changes since commit cab85fd0b481cdbf36477348de75352be3f38ca2:
>
>  gdk-pixbuf: Drop unneeded RPROVIDES (2012-05-12 11:23:27 +0100)
>
> up to 052d78ed7f986e76afb1ce6ef02e94ba1bbc9719:
>
>  package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata (2012-05-13 14:51:26 +0300)
>
> ----------------------------------------------------------------
> Leonid Borisenko (2):
>      package.bbclass: add getter of additional metadata
>      package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata
>
>  meta/classes/package.bbclass     |   11 +++++++++++
>  meta/classes/package_deb.bbclass |    5 +++++
>  meta/classes/package_ipk.bbclass |    5 +++++
>  meta/classes/package_rpm.bbclass |    7 +++++++
>  4 files changed, 28 insertions(+)
>



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

* Re: [PATCH 0/3] Support additional user-defined package metadata
  2012-05-13 13:28 [PATCH 0/3] Support additional user-defined package metadata Leonid Borisenko
                   ` (3 preceding siblings ...)
  2012-05-28  6:40 ` [PING v2] [PATCH 0/2] " Ive Found
@ 2012-05-28  9:44 ` Phil Blundell
  2012-05-28 18:46   ` Ive Found
  2012-06-06  7:28 ` [PING v3] [PATCH 0/2] " Ive Found
  5 siblings, 1 reply; 14+ messages in thread
From: Phil Blundell @ 2012-05-28  9:44 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Sun, 2012-05-13 at 16:28 +0300, Leonid Borisenko wrote:
> Custom metadata field with supported firmware version(s) could be
> included into package control file for preventing of installing packaged
> modifications onto unsupported firmware.

Why isn't RDEPENDS sufficient for this?

p.





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

* Re: [PATCH 0/3] Support additional user-defined package metadata
  2012-05-28  9:44 ` [PATCH 0/3] " Phil Blundell
@ 2012-05-28 18:46   ` Ive Found
  0 siblings, 0 replies; 14+ messages in thread
From: Ive Found @ 2012-05-28 18:46 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On Mon, May 28, 2012 at 12:44 PM, Phil Blundell <philb@gnu.org> wrote:
> On Sun, 2012-05-13 at 16:28 +0300, Leonid Borisenko wrote:
>> Custom metadata field with supported firmware version(s) could be
>> included into package control file for preventing of installing packaged
>> modifications onto unsupported firmware.
>
> Why isn't RDEPENDS sufficient for this?

I didn't think about using RDEPENDS for specifing supported firmware version.

I'll try to discuss possible scenario with RDEPENDS. Correct me please
if I'll miss your point.

So RDEPENDS transforms into Depends field in package control file (I'm
speaking about ipk/deb, as it's the chosen format). Depends field
contains list of packages (with their's versions) on which target
package is depended. Dependencies must be installed before target
package and target package will not be installed if all dependencies
will not be satisfied.

So there could be empty package kindle-touch-firmware on which target
package will depend. Supported version of firmware could be specified
as version of package. Package will be empty as only it's version
string is signifcant.

Using of stub package for describing supported version of stock
proprietary firmware is pretty weird (as for me), but on the other
side it's OK as it uses existing capabilities of package format and
existing support of package format in OE.

However, user-defined metadata fields are existing capabilities of
deb/ipk format too [1].

Also, it could be reasonable to override supported firmware
specification and install package forcefully. Noone could foresee
whether his/her package will work on future firmware version, but it
could in fact work. If package is abandoned and supported firmware
version wasn't changed in long time and user want to install it on
newer firmware, then using of stub package in Depends field will bring
problems. It's not possible to ignore just one package from Depends
field, all packages from Depends field will be ignored.

[1] http://www.debian.org/doc/debian-policy/ch-controlfields.html#s5.7



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

* [PING v3] [PATCH 0/2] Support additional user-defined package metadata
  2012-05-13 13:28 [PATCH 0/3] Support additional user-defined package metadata Leonid Borisenko
                   ` (4 preceding siblings ...)
  2012-05-28  9:44 ` [PATCH 0/3] " Phil Blundell
@ 2012-06-06  7:28 ` Ive Found
  2012-11-03 23:01   ` Sebastian Krzyszkowiak
  5 siblings, 1 reply; 14+ messages in thread
From: Ive Found @ 2012-06-06  7:28 UTC (permalink / raw)
  To: openembedded-core

Please, apply patches. They are small, atomic, tested and doesn't ruin
anything, just adding the feature.

It is essential feature for us, so we've put efforts into implementing
it. We'd like to see it merged into upstream. We are small group of
enthusiasts, it will be very hard for us to maintain fork of OE (it
will be impossible in fact).

On Sun, May 13, 2012 at 4:28 PM, Leonid Borisenko <ive.found@gmail.com> wrote:
> I'm an owner of Kindle Touch. It's basically a computer with ARM
> Cortex-A8 based CPU and Linux. There is a [small] community of
> enthuasists developing homebrew modifications for stock software. For
> distributing of these modifications .ipk package format had been chosen
> with OE as build infrastructure.
>
> There are already several firmware versions for device and some more are
> expected. Every firmware can introduce unpredictable changes, so
> modifications for previous firmware versions could stop working.
>
> Custom metadata field with supported firmware version(s) could be
> included into package control file for preventing of installing packaged
> modifications onto unsupported firmware.
>
> But OE currently doesn't allow to define additional package metadata in
> recipes. Patch fixes it.
>
> There is already RPMSPEC_PREAMBLE variable used in package_rpm.bbclass.
> I think, it is still useful for defining custom macros in header of spec
> file (while additional user-defined metadata is placed somewhere between
> common tags).
>
> I didn't found any way to define newline character inside variable value
> and it is needed to allow multiple [one-line] metadata fields/tags. So
> I've used ability of OE to split list-typed variables (and re-joined
> splitted value with real newline character).
>
> The following changes since commit cab85fd0b481cdbf36477348de75352be3f38ca2:
>
>  gdk-pixbuf: Drop unneeded RPROVIDES (2012-05-12 11:23:27 +0100)
>
> up to 052d78ed7f986e76afb1ce6ef02e94ba1bbc9719:
>
>  package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata (2012-05-13 14:51:26 +0300)
>
> ----------------------------------------------------------------
> Leonid Borisenko (2):
>      package.bbclass: add getter of additional metadata
>      package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata
>
>  meta/classes/package.bbclass     |   11 +++++++++++
>  meta/classes/package_deb.bbclass |    5 +++++
>  meta/classes/package_ipk.bbclass |    5 +++++
>  meta/classes/package_rpm.bbclass |    7 +++++++
>  4 files changed, 28 insertions(+)
>



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

* Re: [PING v3] [PATCH 0/2] Support additional user-defined package metadata
  2012-06-06  7:28 ` [PING v3] [PATCH 0/2] " Ive Found
@ 2012-11-03 23:01   ` Sebastian Krzyszkowiak
  2012-11-06 23:58     ` Otavio Salvador
  0 siblings, 1 reply; 14+ messages in thread
From: Sebastian Krzyszkowiak @ 2012-11-03 23:01 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Has it got rejected, applied, forgotten or what?

I think it would make sense to support it. There was just one answer
asking if RDEPENDS won't be enough and Ive had good point in my
opinion. It's a shame that patch, even after few pings, goes without
proper reply...

On Wed, Jun 6, 2012 at 9:28 AM, Ive Found <ive.found@gmail.com> wrote:
>
> Please, apply patches. They are small, atomic, tested and doesn't ruin
> anything, just adding the feature.
>
> It is essential feature for us, so we've put efforts into implementing
> it. We'd like to see it merged into upstream. We are small group of
> enthusiasts, it will be very hard for us to maintain fork of OE (it
> will be impossible in fact).
>
> On Sun, May 13, 2012 at 4:28 PM, Leonid Borisenko <ive.found@gmail.com> wrote:
> > I'm an owner of Kindle Touch. It's basically a computer with ARM
> > Cortex-A8 based CPU and Linux. There is a [small] community of
> > enthuasists developing homebrew modifications for stock software. For
> > distributing of these modifications .ipk package format had been chosen
> > with OE as build infrastructure.
> >
> > There are already several firmware versions for device and some more are
> > expected. Every firmware can introduce unpredictable changes, so
> > modifications for previous firmware versions could stop working.
> >
> > Custom metadata field with supported firmware version(s) could be
> > included into package control file for preventing of installing packaged
> > modifications onto unsupported firmware.
> >
> > But OE currently doesn't allow to define additional package metadata in
> > recipes. Patch fixes it.
> >
> > There is already RPMSPEC_PREAMBLE variable used in package_rpm.bbclass.
> > I think, it is still useful for defining custom macros in header of spec
> > file (while additional user-defined metadata is placed somewhere between
> > common tags).
> >
> > I didn't found any way to define newline character inside variable value
> > and it is needed to allow multiple [one-line] metadata fields/tags. So
> > I've used ability of OE to split list-typed variables (and re-joined
> > splitted value with real newline character).
> >
> > The following changes since commit cab85fd0b481cdbf36477348de75352be3f38ca2:
> >
> >  gdk-pixbuf: Drop unneeded RPROVIDES (2012-05-12 11:23:27 +0100)
> >
> > up to 052d78ed7f986e76afb1ce6ef02e94ba1bbc9719:
> >
> >  package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata (2012-05-13 14:51:26 +0300)
> >
> > ----------------------------------------------------------------
> > Leonid Borisenko (2):
> >      package.bbclass: add getter of additional metadata
> >      package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata
> >
> >  meta/classes/package.bbclass     |   11 +++++++++++
> >  meta/classes/package_deb.bbclass |    5 +++++
> >  meta/classes/package_ipk.bbclass |    5 +++++
> >  meta/classes/package_rpm.bbclass |    7 +++++++
> >  4 files changed, 28 insertions(+)
> >

--
Sebastian Krzyszkowiak
dos



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

* Re: [PING v3] [PATCH 0/2] Support additional user-defined package metadata
  2012-11-03 23:01   ` Sebastian Krzyszkowiak
@ 2012-11-06 23:58     ` Otavio Salvador
  2012-11-16 18:29       ` [PATCH v2 0/2] Support additional user-defined metadata Leonid Borisenko
  0 siblings, 1 reply; 14+ messages in thread
From: Otavio Salvador @ 2012-11-06 23:58 UTC (permalink / raw)
  To: Sebastian Krzyszkowiak; +Cc: Patches and discussions about the oe-core layer

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

On Sat, Nov 3, 2012 at 9:01 PM, Sebastian Krzyszkowiak <dos@dosowisko.net>wrote:

> Has it got rejected, applied, forgotten or what?
>
> I think it would make sense to support it. There was just one answer
> asking if RDEPENDS won't be enough and Ive had good point in my
> opinion. It's a shame that patch, even after few pings, goes without
> proper reply...


I think this is the right time to resend this patch rebased against current
master so a new review can be done.

-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

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

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

* [PATCH v2 0/2] Support additional user-defined metadata
  2012-11-06 23:58     ` Otavio Salvador
@ 2012-11-16 18:29       ` Leonid Borisenko
  2012-11-16 18:29         ` [PATCH v2 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
                           ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Leonid Borisenko @ 2012-11-16 18:29 UTC (permalink / raw)
  To: openembedded-core

Hi. Here are rebased patches. Thanks for attention!

The following changes since commit b53ea6687b6201c8c5ab5cb0d2a845ef7e7b2abe:

  sstate: Bump version number to deal with layout fixes (2012-11-14 23:37:26 +0000)

up to 899ead84c843641a6732621b9b96960d9bef6ecf:

  package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata (2012-11-16 20:54:14 +0300)

----------------------------------------------------------------
Leonid Borisenko (2):
  package.bbclass: add getter of additional metadata
  package_{ipk, deb, rpm}.bbclass: support additional user-defined
    metadata

 meta/classes/package.bbclass     |   11 +++++++++++
 meta/classes/package_deb.bbclass |    5 +++++
 meta/classes/package_ipk.bbclass |    5 +++++
 meta/classes/package_rpm.bbclass |    7 +++++++
 4 files changed, 28 insertions(+)

-- 
1.7.10.4




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

* [PATCH v2 1/2] package.bbclass: add getter of additional metadata
  2012-11-16 18:29       ` [PATCH v2 0/2] Support additional user-defined metadata Leonid Borisenko
@ 2012-11-16 18:29         ` Leonid Borisenko
  2012-11-16 18:29         ` [PATCH v2 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata Leonid Borisenko
  2012-12-07 17:28         ` [PING] [PATCH v2] Support " Leonid Borisenko
  2 siblings, 0 replies; 14+ messages in thread
From: Leonid Borisenko @ 2012-11-16 18:29 UTC (permalink / raw)
  To: openembedded-core

Two variables are searched for value of additional package metadata:

  * PACKAGE_ADD_METADATA_<PKGTYPE>
  * PACKAGE_ADD_METADATA

First found variable with defined value wins.

<PKGTYPE> is a parameter of getter and expected to be a distinct name
of specific package type. For example: 'DEB' or 'RPM'.

Variable can contain multiple [one-line] metadata fields, separated by
literal sequence '\n'. Separator can be redefined through variable flag
'separator'. Getter returns found value with separator replaced with
newline character.

As side-effect, searched variables acquired flags 'type' (equals to
'list') and 'separator'.

Signed-off-by: Leonid Borisenko <ive.found@gmail.com>
---
 meta/classes/package.bbclass |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 15e505d..6398edf 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -372,6 +372,17 @@ def get_package_mapping (pkg, d):
 
     return pkg
 
+def get_package_additional_metadata (pkg_type, d):
+    base_key = "PACKAGE_ADD_METADATA"
+    for key in ("%s_%s" % (base_key, pkg_type.upper()), base_key):
+        if d.getVar(key) is None:
+            continue
+        d.setVarFlag(key, "type", "list")
+        if d.getVarFlag(key, "separator") is None:
+            d.setVarFlag(key, "separator", "\\n")
+        metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
+        return "\n".join(metadata_fields).strip()
+
 def runtime_mapping_rename (varname, d):
     #bb.note("%s before: %s" % (varname, d.getVar(varname, True)))
 
-- 
1.7.10.4




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

* [PATCH v2 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata
  2012-11-16 18:29       ` [PATCH v2 0/2] Support additional user-defined metadata Leonid Borisenko
  2012-11-16 18:29         ` [PATCH v2 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
@ 2012-11-16 18:29         ` Leonid Borisenko
  2012-12-07 17:28         ` [PING] [PATCH v2] Support " Leonid Borisenko
  2 siblings, 0 replies; 14+ messages in thread
From: Leonid Borisenko @ 2012-11-16 18:29 UTC (permalink / raw)
  To: openembedded-core

Additional metadata from user-defined variable is written into
control/spec file of binary package.

Three variables are searched for adiitional package metadata:

  * PACKAGE_ADD_METADATA_<PKGTYPE>_<PN>
  * PACKAGE_ADD_METADATA_<PKGTYPE>
  * PACKAGE_ADD_METADATA

First found variable with defined value wins.

<PN> is a package name. <PKGTYPE> is a distinct name of specific
package type:

  * IPK for .ipk packages
  * DEB for .deb packages
  * RPM for .rpm packages

Variable can contain multiple [one-line] metadata fields separated by
literal sequence '\n'. Separator can be redefined through variable flag
'separator'. In package control/spec file separator is replaced by
newline character.

Signed-off-by: Leonid Borisenko <ive.found@gmail.com>
---
 meta/classes/package_deb.bbclass |    5 +++++
 meta/classes/package_ipk.bbclass |    5 +++++
 meta/classes/package_rpm.bbclass |    7 +++++++
 3 files changed, 17 insertions(+)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index d273cb0..d59a93d 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -332,6 +332,11 @@ python do_package_deb () {
             raise bb.build.FuncFailed("Missing field for deb generation: %s" % value)
         # more fields
 
+        custom_fields_chunk = get_package_additional_metadata("deb", localdata)
+        if custom_fields_chunk is not None:
+            ctrlfile.write(unicode(custom_fields_chunk))
+            ctrlfile.write("\n")
+
         mapping_rename_hook(localdata)
 
         def debian_cmp_remap(var):
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 4bf1b10..47f5091 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -370,6 +370,11 @@ python do_package_ipk () {
             raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value)
         # more fields
 
+        custom_fields_chunk = get_package_additional_metadata("ipk", localdata)
+        if custom_fields_chunk is not None:
+            ctrlfile.write(custom_fields_chunk)
+            ctrlfile.write("\n")
+
         mapping_rename_hook(localdata)
 
         def debian_cmp_remap(var):
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 1ff92ce..6545701 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -720,6 +720,7 @@ python write_specfile () {
     srcmaintainer  = d.getVar('MAINTAINER', True)
     srchomepage    = d.getVar('HOMEPAGE', True)
     srcdescription = d.getVar('DESCRIPTION', True) or "."
+    srccustomtagschunk = get_package_additional_metadata("rpm", d)
 
     srcdepends     = strip_multilib_deps(d.getVar('DEPENDS', True), d)
     srcrdepends    = []
@@ -773,6 +774,7 @@ python write_specfile () {
         splitlicense = (localdata.getVar('LICENSE', True) or "")
         splitsection = (localdata.getVar('SECTION', True) or "")
         splitdescription = (localdata.getVar('DESCRIPTION', True) or ".")
+        splitcustomtagschunk = get_package_additional_metadata("rpm", localdata)
 
         translate_vers('RDEPENDS', localdata)
         translate_vers('RRECOMMENDS', localdata)
@@ -837,6 +839,9 @@ python write_specfile () {
             spec_preamble_bottom.append('License: %s' % splitlicense)
         spec_preamble_bottom.append('Group: %s' % splitsection)
 
+        if srccustomtagschunk != splitcustomtagschunk:
+            spec_preamble_bottom.append(splitcustomtagschunk)
+
         # Replaces == Obsoletes && Provides
         robsoletes = bb.utils.explode_dep_versions2(splitrobsoletes or "")
         rprovides = bb.utils.explode_dep_versions2(splitrprovides or "")
@@ -927,6 +932,8 @@ python write_specfile () {
     spec_preamble_top.append('Group: %s' % srcsection)
     spec_preamble_top.append('Packager: %s' % srcmaintainer)
     spec_preamble_top.append('URL: %s' % srchomepage)
+    if srccustomtagschunk:
+        spec_preamble_top.append(srccustomtagschunk)
     tail_source(d)
 
     # Replaces == Obsoletes && Provides
-- 
1.7.10.4




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

* [PING] [PATCH v2] Support additional user-defined metadata
  2012-11-16 18:29       ` [PATCH v2 0/2] Support additional user-defined metadata Leonid Borisenko
  2012-11-16 18:29         ` [PATCH v2 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
  2012-11-16 18:29         ` [PATCH v2 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata Leonid Borisenko
@ 2012-12-07 17:28         ` Leonid Borisenko
  2 siblings, 0 replies; 14+ messages in thread
From: Leonid Borisenko @ 2012-12-07 17:28 UTC (permalink / raw)
  To: openembedded-core

Hi. Any comments?



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

end of thread, other threads:[~2012-12-07 17:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-13 13:28 [PATCH 0/3] Support additional user-defined package metadata Leonid Borisenko
2012-05-13 13:28 ` [PATCH 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
2012-05-13 13:28 ` [PATCH 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata Leonid Borisenko
2012-05-18 18:34 ` [PATCH 0/3] Support additional user-defined package metadata Ive Found
2012-05-28  6:40 ` [PING v2] [PATCH 0/2] " Ive Found
2012-05-28  9:44 ` [PATCH 0/3] " Phil Blundell
2012-05-28 18:46   ` Ive Found
2012-06-06  7:28 ` [PING v3] [PATCH 0/2] " Ive Found
2012-11-03 23:01   ` Sebastian Krzyszkowiak
2012-11-06 23:58     ` Otavio Salvador
2012-11-16 18:29       ` [PATCH v2 0/2] Support additional user-defined metadata Leonid Borisenko
2012-11-16 18:29         ` [PATCH v2 1/2] package.bbclass: add getter of additional metadata Leonid Borisenko
2012-11-16 18:29         ` [PATCH v2 2/2] package_{ipk, deb, rpm}.bbclass: support additional user-defined metadata Leonid Borisenko
2012-12-07 17:28         ` [PING] [PATCH v2] Support " Leonid Borisenko

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.