Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: gnome@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 1/7] gnome2-utils.eclass: Make gnome2_icon_cache_update update all themes
Date: Mon, 17 Apr 2017 11:08:09
Message-Id: 20170417110747.16196-1-mgorny@gentoo.org
1 Make the gnome2_icon_cache_update function update all icon themes rather
2 than depending on gnome2_icon_savelist to select themes to update. This
3 makes the function easier to use whenever the developer needs it
4 explicitly (i.e. knows that themes are installed), while the overhead of
5 regenerating multiple caches is neglible.
6 ---
7 eclass/gnome2-utils.eclass | 18 +++++++++---------
8 1 file changed, 9 insertions(+), 9 deletions(-)
9
10 diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
11 index f2aa2391a532..7db092e1ec66 100644
12 --- a/eclass/gnome2-utils.eclass
13 +++ b/eclass/gnome2-utils.eclass
14 @@ -240,30 +240,30 @@ gnome2_icon_cache_update() {
15 local retval=0
16 local fails=( )
17
18 - for dir in ${GNOME2_ECLASS_ICONS}
19 + for dir in "${EROOT%/}"/usr/share/icons/*
20 do
21 - if [[ -f "${EROOT}${dir}/index.theme" ]] ; then
22 + if [[ -f "${dir}/index.theme" ]] ; then
23 local rv=0
24
25 - "${updater}" -qf "${EROOT}${dir}"
26 + "${updater}" -qf "${dir}"
27 rv=$?
28
29 if [[ ! $rv -eq 0 ]] ; then
30 - debug-print "Updating cache failed on ${EROOT}${dir}"
31 + debug-print "Updating cache failed on ${dir}"
32
33 # Add to the list of failures
34 - fails[$(( ${#fails[@]} + 1 ))]="${EROOT}${dir}"
35 + fails+=( "${dir}" )
36
37 retval=2
38 fi
39 - elif [[ $(ls "${EROOT}${dir}") = "icon-theme.cache" ]]; then
40 + elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then
41 # Clear stale cache files after theme uninstallation
42 - rm "${EROOT}${dir}/icon-theme.cache"
43 + rm "${dir}/icon-theme.cache"
44 fi
45
46 - if [[ -z $(ls "${EROOT}${dir}") ]]; then
47 + if [[ -z $(ls "${dir}") ]]; then
48 # Clear empty theme directories after theme uninstallation
49 - rmdir "${EROOT}${dir}"
50 + rmdir "${dir}"
51 fi
52 done
53
54 --
55 2.12.2

Replies