diff mbox series

[3/3] gtk-icon-cache: clean up DEPENDS

Message ID 20190329142905.20123-3-ross.burton@intel.com
State Accepted
Commit 078950f6ff88d406894229337b2b367ba049ff44
Headers show
Series [1/3] Revert "gtk+3: add librsvg to DEPENDS" | expand

Commit Message

Ross Burton March 29, 2019, 2:29 p.m. UTC
Instead of using DEPENDS += use _append to ensure that these additions can't get
overwritten.

Also use gtk+3-native instead gtk-icon-utils-native as that recipe no longer
exists and is provided by gtk+3-native for compatibility.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/classes/gtk-icon-cache.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Richard Purdie April 1, 2019, 10:44 a.m. UTC | #1
On Fri, 2019-03-29 at 14:29 +0000, Ross Burton wrote:
> Instead of using DEPENDS += use _append to ensure that these additions can't get

> overwritten.

> 

> Also use gtk+3-native instead gtk-icon-utils-native as that recipe no longer

> exists and is provided by gtk+3-native for compatibility.

> 

> Signed-off-by: Ross Burton <ross.burton@intel.com>

> ---

>  meta/classes/gtk-icon-cache.bbclass | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass

> index d87167aec09..3572f62ebb6 100644

> --- a/meta/classes/gtk-icon-cache.bbclass

> +++ b/meta/classes/gtk-icon-cache.bbclass

> @@ -1,8 +1,8 @@

>  FILES_${PN} += "${datadir}/icons/hicolor"

>  

> -DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-icon-utils-native"

> +DEPENDS_append = " ${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk+3-native"


I don't mind the changes themselves but I do have a bit of an issue
with changing to use DEPENDS_append.

In general recipes should be doing DEPENDS += "xxx", unless its at the
start of the recipe before any inherits (and even then += is fine).

_append is much harder to override and whilst it can be needed (e.g.
the hoops base.bbclass has to jump through), I'd much prefer to
encourage people to use +=.

I appreciate its a style thing and there is no "right" answer but its
one do have a fairly strong preference over, mainly for the
overridability. Our _append/_remove/_prepend operators are operators of
last resort to me.

Cheers,

Richard



-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
index d87167aec09..3572f62ebb6 100644
--- a/meta/classes/gtk-icon-cache.bbclass
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -1,8 +1,8 @@ 
 FILES_${PN} += "${datadir}/icons/hicolor"
 
-DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-icon-utils-native"
+DEPENDS_append = " ${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk+3-native"
 
-PACKAGE_WRITE_DEPS += "gtk-icon-utils-native gdk-pixbuf-native"
+PACKAGE_WRITE_DEPS += "gtk+3-native gdk-pixbuf-native"
 
 gtk_icon_cache_postinst() {
 if [ "x$D" != "x" ]; then