[oe-commits] Martin Jansa : gpe-icons: cleanup include file a bit, don' t inherit update-alternatives, just do it in postins/ prerm with distro override

git version control git at git.openembedded.org
Fri Jan 15 00:17:13 UTC 2010


Module: openembedded.git
Branch: shr/merge
Commit: cbd7025530add28ba6203ae011c41ee5bb2ccace
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=cbd7025530add28ba6203ae011c41ee5bb2ccace

Author: Martin Jansa <Martin.Jansa at gmail.com>
Date:   Wed Jan 13 13:05:07 2010 +0100

gpe-icons: cleanup include file a bit, don't inherit update-alternatives, just do it in postins/prerm with distro override

Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>

---

 recipes/gpe-icons/gpe-icons.inc        |   19 +++++++++++++++----
 recipes/gpe-icons/gpe-icons_0.25.bb    |    7 ++-----
 recipes/gpe-icons/gpe-theme-neo_git.bb |    7 ++++---
 3 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/recipes/gpe-icons/gpe-icons.inc b/recipes/gpe-icons/gpe-icons.inc
index 18dd39b..fca142a 100644
--- a/recipes/gpe-icons/gpe-icons.inc
+++ b/recipes/gpe-icons/gpe-icons.inc
@@ -1,17 +1,23 @@
 SECTION = "gpe"
 RDEPENDS += "gdk-pixbuf-loader-png"
 
-INHERIT = "gpe"
-INHERIT_shr = "gpe update-alternatives"
-inherit ${INHERIT}
+#only icons present in the package
+PACKAGE_ARCH = "all"
 
-INC_PR = "r4"
+INC_PR = "r5"
 
 ALTERNATIVE_NAME = "gpe-pixmaps"
 ALTERNATIVE_LINK = "${datadir}/gpe/pixmaps"
 ALTERNATIVE_PATH = "${datadir}/gpe/pixmaps.${PN}"
 ALTERNATIVE_PRIORITY ?= 1
 
+# copy icons from other alternatives if they are not provided by current alternative
+# ie gpe-sketchbook install own icon to pixmaps dir even before gpe-icons_*.bb is installed
+# so if we switch pixmaps link to neo theme, there would be no icon for gpe-sketchbook 
+# unless we copy it to neo theme in postinst too
+# inherit update-alternatives is not used, because not all distributions want to use it 
+# and conditional inherit is a bit difficult to use (inherit ${GPE_INHERIT} works, but only if we always want at least 1 bbclass)
+
 pkg_postinst_shr() {
         if [[ -e ${ALTERNATIVE_LINK} && ! -h ${ALTERNATIVE_LINK} ]] ; then
                 echo "warn: ${ALTERNATIVE_LINK} exists and it's not a link!"
@@ -35,4 +41,9 @@ pkg_postinst_shr() {
                           fi; 
                 done
         done
+        update-alternatives --install ${ALTERNATIVE_LINK} ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH} ${ALTERNATIVE_PRIORITY}
+}
+
+pkg_postrm_shr() {
+        update-alternatives --remove ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH}
 }
diff --git a/recipes/gpe-icons/gpe-icons_0.25.bb b/recipes/gpe-icons/gpe-icons_0.25.bb
index 7070e12..14f7f26 100644
--- a/recipes/gpe-icons/gpe-icons_0.25.bb
+++ b/recipes/gpe-icons/gpe-icons_0.25.bb
@@ -1,13 +1,10 @@
 DESCRIPTION = "Common icons for GPE"
 LICENSE = "GPL"
-SECTION = "gpe"
-
-RDEPENDS = "gdk-pixbuf-loader-png"
 
 PR = "${INC_PR}.0"
 
-#only icons present in the package
-PACKAGE_ARCH = "all"
+inherit gpe
+
 FILES_${PN} = "${datadir}/gpe"
 
 #Only SHR is using u-a for gpe-icons
diff --git a/recipes/gpe-icons/gpe-theme-neo_git.bb b/recipes/gpe-icons/gpe-theme-neo_git.bb
index 3f0f7b1..402eef6 100644
--- a/recipes/gpe-icons/gpe-theme-neo_git.bb
+++ b/recipes/gpe-icons/gpe-theme-neo_git.bb
@@ -1,8 +1,7 @@
 DESCRIPTION = "nEo GPE theme - a very fast, high contrast GPE theme"
-SECTION = "gpe"
 HOMEPAGE = "http://jmccloud.jm.funpic.de"
 AUTHOR = "Jesus McCloud <bernd.pruenster at gmail.com"
-RDEPENDS = "gdk-pixbuf-loader-png gpe-filemanager gpe-sketchbook"
+RDEPENDS = "gpe-filemanager gpe-sketchbook"
 RRECOMMENDS = "elementary-theme-neo e-wm-theme-illume-neo gtk-theme-neo libframeworkd-phonegui-efl-theme-neo etk-theme-neo icon-theme-neo"
 LICENSE = "unknown"
 
@@ -15,6 +14,9 @@ S = "${WORKDIR}/git/gpe/theme-neo/pixmaps"
 
 require gpe-icons.inc
 
+ALTERNATIVE_PRIORITY = 10
+
+#installed to /usr/share/gpe/pixmaps.gpe-theme-neo by default as we don't want to overwrite default icons from gpe-icons package
 do_install() {
         install -d ${D}${datadir}/gpe/
         install -d ${D}${datadir}/gpe/pixmaps.${PN}/
@@ -22,4 +24,3 @@ do_install() {
 }
 
 FILES_${PN} = "${datadir}/gpe/pixmaps.${PN}/"
-





More information about the Openembedded-commits mailing list