[1/2] nopackages.bbclass: Move to nopackages_base.bbclass

Submitted by Fredrik Gustafsson on June 23, 2020, 11:13 a.m. | Patch ID: 173826

Details

Message ID 20200623111328.5838-2-fredrigu@axis.com
State New
Headers show

Commit Message

Fredrik Gustafsson June 23, 2020, 11:13 a.m.
When for example adding an other package mananger a two rows
deltask do_package_write_PKGMGR
deltask do_package_write_PKGMGR_setscene
is needed to be added to nopackages.bbclass. When adding the new package
manager in a new layer in order to extend poky (rather than forking it)
the whole nopackages.bbclass needs to be copied which is a maintenance
problem. Moving nopackages.bbclass to nopackages.bbclass would make the
new layer just adding an image.bbclass containing:
inherit nopackages_base.bbclass
deltask do_package_write_PKGMGR
deltask do_package_write_PKGMGR_setscene

Which is much easier to maintain.

Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
---
 meta/classes/nopackages.bbclass      | 15 +++------------
 meta/classes/nopackages_base.bbclass | 12 ++++++++++++
 2 files changed, 15 insertions(+), 12 deletions(-)
 create mode 100644 meta/classes/nopackages_base.bbclass

Patch hide | download patch | download mbox

diff --git a/meta/classes/nopackages.bbclass b/meta/classes/nopackages.bbclass
index 559f5078bd..78bbd8c85c 100644
--- a/meta/classes/nopackages.bbclass
+++ b/meta/classes/nopackages.bbclass
@@ -1,12 +1,3 @@ 
-deltask do_package
-deltask do_package_write_rpm
-deltask do_package_write_ipk
-deltask do_package_write_deb
-deltask do_package_qa
-deltask do_packagedata
-deltask do_package_setscene
-deltask do_package_write_rpm_setscene
-deltask do_package_write_ipk_setscene
-deltask do_package_write_deb_setscene
-deltask do_package_qa_setscene
-deltask do_packagedata_setscene
+# This file should only inherit nopackages_base. This is to make
+# this file easy to extend from an other layer.
+inherit nopackages_base
diff --git a/meta/classes/nopackages_base.bbclass b/meta/classes/nopackages_base.bbclass
new file mode 100644
index 0000000000..e898cef00f
--- /dev/null
+++ b/meta/classes/nopackages_base.bbclass
@@ -0,0 +1,12 @@ 
+deltask do_package
+deltask do_package_qa
+deltask do_packagedata
+deltask do_package_setscene
+deltask do_package_qa_setscene
+deltask do_packagedata_setscene
+deltask do_package_write_rpm
+deltask do_package_write_deb
+deltask do_package_write_ipk
+deltask do_package_write_rpm_setscene
+deltask do_package_write_deb_setscene
+deltask do_package_write_ipk_setscene

Comments

Richard Purdie June 23, 2020, 11:41 a.m.
On Tue, 2020-06-23 at 13:13 +0200, Fredrik Gustafsson wrote:
> When for example adding an other package mananger a two rows
> deltask do_package_write_PKGMGR
> deltask do_package_write_PKGMGR_setscene
> is needed to be added to nopackages.bbclass. When adding the new
> package
> manager in a new layer in order to extend poky (rather than forking
> it)
> the whole nopackages.bbclass needs to be copied which is a
> maintenance
> problem. Moving nopackages.bbclass to nopackages.bbclass would make
> the
> new layer just adding an image.bbclass containing:
> inherit nopackages_base.bbclass
> deltask do_package_write_PKGMGR
> deltask do_package_write_PKGMGR_setscene
> 
> Which is much easier to maintain.
> 
> Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
> ---
>  meta/classes/nopackages.bbclass      | 15 +++------------
>  meta/classes/nopackages_base.bbclass | 12 ++++++++++++
>  2 files changed, 15 insertions(+), 12 deletions(-)
>  create mode 100644 meta/classes/nopackages_base.bbclass

I personally think "_base" bbclasses are not helpful to making our code
easier to understand and I'd prefer to see fewer of them, not more.

I can't remember if deltask support multiple parameters but if not, it
can be made to. That would then allow this to be configured with a
variable. I'd suggest we explore other options along those lines for
this.

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#139828): https://lists.openembedded.org/g/openembedded-core/message/139828
Mute This Topic: https://lists.openembedded.org/mt/75057634/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-