summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@lri11-52.lri.fr>2008-03-12 11:32:28 +0100
committerroot <root@lri11-52.lri.fr>2008-03-12 11:32:28 +0100
commit8d160d25e2e8bd22dd69d32d5998e095c5c1a9e7 (patch)
treec762515ba8649e516707ba228f66274edb361a23
parentsync eclasses with gnome overlay (diff)
downloadremi-8d160d25e2e8bd22dd69d32d5998e095c5c1a9e7.tar.gz
remi-8d160d25e2e8bd22dd69d32d5998e095c5c1a9e7.tar.bz2
remi-8d160d25e2e8bd22dd69d32d5998e095c5c1a9e7.zip
fix the gtk icon update foo (same changes in the gnome overlay)
-rw-r--r--eclass/gnome2-utils.eclass36
-rw-r--r--eclass/gnome2.eclass1
2 files changed, 22 insertions, 15 deletions
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index a0de44e..1bfacf1 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -110,6 +110,15 @@ gnome2_gconf_uninstall() {
}
+# Find the icons that are about to be installed and save their location
+# in the GNOME2_ECLASS_ICONS environment variable
+gnome2_icons_savelist() {
+ pushd "${D}" &> /dev/null
+ export GNOME2_ECLASS_ICONS=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d)
+ popd &> /dev/null
+}
+
+
# Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild
# have installed anything under that location.
gnome2_icon_cache_update() {
@@ -120,24 +129,29 @@ gnome2_icon_cache_update() {
return
fi
+ if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then
+ return
+ fi
+
+
ebegin "Updating icons cache"
local retval=0
local fails=( )
- for dir in $(find "${ROOT}/usr/share/icons" -maxdepth 1 -mindepth 1 -type d)
+ for dir in ${GNOME2_ECLASS_ICONS}
do
- if [[ -f "${dir}/index.theme" ]] ; then
+ if [[ -f "${ROOT}${dir}/index.theme" ]] ; then
local rv=0
- "${updater}" -qf "${dir}"
+ "${updater}" -qf "${ROOT}${dir}"
rv=$?
if [[ ! $rv -eq 0 ]] ; then
- debug-print "Updating cache failed on ${dir}"
+ debug-print "Updating cache failed on ${ROOT}${dir}"
# Add to the list of failures
- fails[$(( ${#fails[@]} + 1 ))]=$dir
+ fails[$(( ${#fails[@]} + 1 ))]="${ROOT}${dir}"
retval=2
fi
@@ -146,16 +160,8 @@ gnome2_icon_cache_update() {
eend ${retval}
- for (( i = 0 ; i < ${#fails[@]} ; i++ )) ; do
- ### HACK!! This is needed until bash 3.1 is unmasked.
- ## The current stable version of bash lists the sizeof fails to be 1
- ## when there are no elements in the list because it is declared local.
- ## In order to prevent the declaration from being in global scope, we
- ## this hack to prevent an empty error message being printed for stable
- ## users. -- compnerd && allanonjl
- if [[ "${fails[i]}" != "" && "${fails[i]}" != "()" ]] ; then
- eerror "Failed to update cache with icon ${fails[i]}"
- fi
+ for f in "${fails[@]}" ; do
+ eerror "Failed to update cache with icon $f"
done
}
diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass
index 6dae2ca..84eb2ed 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/gnome2.eclass
@@ -108,6 +108,7 @@ gnome2_src_install() {
gnome2_pkg_preinst() {
gnome2_gconf_savelist
+ gnome2_icons_savelist
}
gnome2_pkg_postinst() {