All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [oe-commits] Richard Purdie : package_rpm: Add custom extension support for spec generation.
       [not found] <20140902135015.93AF7504BC@opal.openembedded.org>
@ 2014-09-03  1:51 ` Hongxu Jia
  2014-09-03 10:15   ` Burton, Ross
  0 siblings, 1 reply; 4+ messages in thread
From: Hongxu Jia @ 2014-09-03  1:51 UTC (permalink / raw)
  To: Richard Purdie; +Cc: openembedded-devel

Build failure:
https://autobuilder.yoctoproject.org/main/builders/poky-tiny/builds/30/steps/BuildImages/logs/stdio
...

ERROR: Error executing a python function in /home/pokybuild/yocto-autobuilder/yocto-worker/poky-tiny/build/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_3.16.bb:

The stack trace of python calls that resulted in this exception/failure was:
File: 'write_specfile', lineno: 554, function: <module>
      0550:
      0551:    specfile.close()
      0552:
      0553:
  *** 0554:write_specfile(d)
      0555:
File: 'write_specfile', lineno: 420, function: write_specfile
      0416:            bb.note("Not creating empty RPM package for %s" % splitname)
      0417:        else:
      0418:            spec_files_bottom.append('%%files -n %s' % splitname)
      0419:            if extra_pkgdata:
  *** 0420:                package_rpm_extra_pkgdata(splitname, spec_files_bottom, localdata)
      0421:            spec_files_bottom.append('%defattr(-,-,-,-)')
      0422:            if file_list:
      0423:                bb.note("Creating RPM package for %s" % splitname)
      0424:                spec_files_bottom.extend(file_list)
Exception: NameError: global name 'package_rpm_extra_pkgdata' is not defined

...

//Hongxu

On 09/02/2014 09:50 PM, git@opal.openembedded.org wrote:
> Module: openembedded-core.git
> Branch: master-next
> Commit: 4b42982b8e6d859315c0f95dc0d6e4bcadf9a785
> URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=4b42982b8e6d859315c0f95dc0d6e4bcadf9a785
>
> Author: Richard Purdie <richard.purdie@linuxfoundation.org>
> Date:   Mon Sep  1 17:32:26 2014 +0100
>
> package_rpm: Add custom extension support for spec generation.
>
> Add hooks to allow customisation of the rpm spec files. Since python functions
> aren't visible in the data store, one variable is used to trigger the call to
> a separately named function. A dummy function is not provided since this then
> triggers various class ordering complexities which are best avoided.
>
> Ultimately this will be replaced by a refactor of the code to generate the
> spec file using a python class.
>
> This allows the tizen layer to add hooks for the security manifests for
> example.
>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
>
> ---
>
>   meta/classes/package_rpm.bbclass | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
> index 0a32b3e..65b4463 100644
> --- a/meta/classes/package_rpm.bbclass
> +++ b/meta/classes/package_rpm.bbclass
> @@ -293,6 +293,7 @@ python write_specfile () {
>       spec_files_bottom = []
>   
>       perfiledeps = (d.getVar("MERGEPERFILEDEPS", True) or "0") == "0"
> +    extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA", True) or "0") == "0"
>   
>       for pkg in packages.split():
>           localdata = bb.data.createCopy(d)
> @@ -373,6 +374,8 @@ python write_specfile () {
>               else:
>                   bb.note("Creating RPM package for %s" % splitname)
>                   spec_files_top.append('%files')
> +                if extra_pkgdata:
> +                    package_rpm_extra_pkgdata(splitname, spec_files_top, localdata)
>                   spec_files_top.append('%defattr(-,-,-,-)')
>                   if file_list:
>                       bb.note("Creating RPM package for %s" % splitname)
> @@ -479,6 +482,8 @@ python write_specfile () {
>               bb.note("Not creating empty RPM package for %s" % splitname)
>           else:
>               spec_files_bottom.append('%%files -n %s' % splitname)
> +            if extra_pkgdata:
> +                package_rpm_extra_pkgdata(splitname, spec_files_bottom, localdata)
>               spec_files_bottom.append('%defattr(-,-,-,-)')
>               if file_list:
>                   bb.note("Creating RPM package for %s" % splitname)
>



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

* Re: [oe-commits] Richard Purdie : package_rpm: Add custom extension support for spec generation.
  2014-09-03  1:51 ` [oe-commits] Richard Purdie : package_rpm: Add custom extension support for spec generation Hongxu Jia
@ 2014-09-03 10:15   ` Burton, Ross
  2014-09-03 10:16     ` Burton, Ross
  0 siblings, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2014-09-03 10:15 UTC (permalink / raw)
  To: OE-devel; +Cc: Richard Purdie

On 3 September 2014 02:51, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> Exception: NameError: global name 'package_rpm_extra_pkgdata' is not defined

If you set the variable you also need to provide the function.

Ross


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

* Re: [oe-commits] Richard Purdie : package_rpm: Add custom extension support for spec generation.
  2014-09-03 10:15   ` Burton, Ross
@ 2014-09-03 10:16     ` Burton, Ross
  2014-09-03 10:23       ` Burton, Ross
  0 siblings, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2014-09-03 10:16 UTC (permalink / raw)
  To: OE-devel; +Cc: Richard Purdie

Actually, that patch has a typo in the logic:

+    extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA", True) or "0") == "0"

== "1", surely.

Ross

On 3 September 2014 11:15, Burton, Ross <ross.burton@intel.com> wrote:
> On 3 September 2014 02:51, Hongxu Jia <hongxu.jia@windriver.com> wrote:
>> Exception: NameError: global name 'package_rpm_extra_pkgdata' is not defined
>
> If you set the variable you also need to provide the function.
>
> Ross


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

* Re: [oe-commits] Richard Purdie : package_rpm: Add custom extension support for spec generation.
  2014-09-03 10:16     ` Burton, Ross
@ 2014-09-03 10:23       ` Burton, Ross
  0 siblings, 0 replies; 4+ messages in thread
From: Burton, Ross @ 2014-09-03 10:23 UTC (permalink / raw)
  To: OE-devel; +Cc: Richard Purdie

On 3 September 2014 11:16, Burton, Ross <ross.burton@intel.com> wrote:
> Actually, that patch has a typo in the logic:
>
> +    extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA", True) or "0") == "0"
>
> == "1", surely.

FYI, the patch in master-next has the correct logic.

Ross


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

end of thread, other threads:[~2014-09-03 10:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20140902135015.93AF7504BC@opal.openembedded.org>
2014-09-03  1:51 ` [oe-commits] Richard Purdie : package_rpm: Add custom extension support for spec generation Hongxu Jia
2014-09-03 10:15   ` Burton, Ross
2014-09-03 10:16     ` Burton, Ross
2014-09-03 10:23       ` Burton, Ross

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.