Patchwork [2/5] sato-icon-theme: make postinst scriplet run at do_rootfs time

login
register
mail settings
Submitter Laurentiu Palcu
Date Aug. 3, 2012, 8:19 p.m.
Message ID <8db627a00e95e0f72a8c18eb31ddd5c06df99454.1344022584.git.laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/33755/
State New
Headers show

Comments

Laurentiu Palcu - Aug. 3, 2012, 8:19 p.m.
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 .../sato-icon-theme/sato-icon-theme.inc            |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Ross Burton - Aug. 6, 2012, 9:28 a.m.
On 3 August 2012 21:19, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
>  pkg_postinst_${PN} () {
> -        if [ "x$D" != "x" ]; then
> -                exit 1
> +        gtk-update-icon-cache -q $D/usr/share/icons/Sato
> +        if [ ! -d $D/etc/gtk-2.0 ]; then
> +            mkdir -p $D/etc/gtk-2.0
>          fi
> -        gtk-update-icon-cache -q /usr/share/icons/Sato
> -        echo 'gtk-icon-theme-name = "Sato"' >> /etc/gtk-2.0/gtkrc
> +        echo 'gtk-icon-theme-name = "Sato"' >> $D/etc/gtk-2.0/gtkrc
>  }

Surely sato-icon-theme should be inheriting the gtk-icon-cache class
to remove all of the duplicated logic?

Ross

Patch

diff --git a/meta/recipes-sato/sato-icon-theme/sato-icon-theme.inc b/meta/recipes-sato/sato-icon-theme/sato-icon-theme.inc
index 9fd1012..ba15514 100644
--- a/meta/recipes-sato/sato-icon-theme/sato-icon-theme.inc
+++ b/meta/recipes-sato/sato-icon-theme/sato-icon-theme.inc
@@ -6,7 +6,7 @@  LICENSE = "CC-BY-SA-3.0"
 LIC_FILES_CHKSUM = "file://COPYING;md5=56a830bbe6e4697fe6cbbae01bb7c2b2"
 
 SECTION = "x11"
-DEPENDS = ""
+DEPENDS = "gtk+-native"
 
 inherit autotools pkgconfig allarch
 
@@ -17,9 +17,9 @@  EXTRA_OECONF += "--with-iconmap=${STAGING_LIBDIR_NATIVE}/../libexec/icon-name-ma
 #explictly setting "Sato" as default icon theme to avoid icon missing due to
 #tricky race condition
 pkg_postinst_${PN} () {
-        if [ "x$D" != "x" ]; then
-                exit 1
+        gtk-update-icon-cache -q $D/usr/share/icons/Sato
+        if [ ! -d $D/etc/gtk-2.0 ]; then
+            mkdir -p $D/etc/gtk-2.0
         fi
-        gtk-update-icon-cache -q /usr/share/icons/Sato
-        echo 'gtk-icon-theme-name = "Sato"' >> /etc/gtk-2.0/gtkrc
+        echo 'gtk-icon-theme-name = "Sato"' >> $D/etc/gtk-2.0/gtkrc
 }