Lines 46-51
xdg_desktop_database_check() {
Link Here
|
46 |
fi |
46 |
fi |
47 |
} |
47 |
} |
48 |
|
48 |
|
|
|
49 |
gnome2_icon_cache_check() { |
50 |
type -P gtk-update-icon-cache &>/dev/null || return |
51 |
|
52 |
local d f all_files=() missing |
53 |
for d in usr/share/icons/*/; do |
54 |
# gnome2_icon_cache_update updates only themes with an index |
55 |
[[ -f ${d}/index.theme ]] || continue |
56 |
|
57 |
local files=() find_args=( |
58 |
# gtk-update-icon-cache supports only specific file |
59 |
# suffixes; match that to avoid false positives |
60 |
'(' -name '*.png' -o -name '*.svg' |
61 |
-o -name '*.xpm' -o -name '*.icon' ')' |
62 |
) |
63 |
# if the cache does not exist at all, we complain for any file |
64 |
# otherwise, we look for files newer than the cache |
65 |
[[ -f ${d}/icon-theme.cache ]] && |
66 |
find_args+=( -newercm "${d}"/icon-theme.cache ) || missing=1 |
67 |
|
68 |
# (use -mindepth 2 to easily skip the cache files) |
69 |
while read -r -d $'\0' f; do |
70 |
files+=( "${f}" ) |
71 |
done < <(find "${d}" -mindepth 2 -type f "${find_args[@]}" -print0) |
72 |
|
73 |
# if any files were found, update the db to avoid repeating |
74 |
# the warning for subsequent packages |
75 |
if [[ ${files[@]} ]]; then |
76 |
all_files+=("${files[@]}") |
77 |
addwrite "${d}" |
78 |
gtk-update-icon-cache -qf "${d}" |
79 |
fi |
80 |
done |
81 |
|
82 |
# preinst initializes the baseline state for the posinst check |
83 |
[[ ${PORTAGE_QA_PHASE} == preinst ]] && return |
84 |
|
85 |
# parallel-install makes it impossible to blame a specific package |
86 |
has parallel-install ${FEATURES} && return |
87 |
|
88 |
# avoid false-positives on first install (bug 649464) |
89 |
[[ ${PN} == gtk-update-icon-cache ]] && return |
90 |
|
91 |
# The eqatag call is prohibitively expensive if the cache is |
92 |
# missing and there are a large number of files. |
93 |
if [[ -z ${missing} && ${all_files[@]} ]]; then |
94 |
eqawarn "QA Notice: new icons were found installed but GTK+ icon cache" |
95 |
eqawarn "has not been updated:" |
96 |
eqatag -v gnome2-utils.icon-cache "${all_files[@]/#//}" |
97 |
eqawarn "Please make sure to call gnome2_icon_cache_update()" |
98 |
eqawarn "in pkg_postinst() and pkg_postrm() phases of appropriate pkgs." |
99 |
fi |
100 |
} |
101 |
|
49 |
xdg_mimeinfo_database_check() { |
102 |
xdg_mimeinfo_database_check() { |
50 |
type -P update-mime-database &>/dev/null || return |
103 |
type -P update-mime-database &>/dev/null || return |
51 |
|
104 |
|
Lines 92-97
xdg_mimeinfo_database_check() {
Link Here
|
92 |
xdg_utils_postinst_check() { |
145 |
xdg_utils_postinst_check() { |
93 |
cd "${EROOT:-/}" || die |
146 |
cd "${EROOT:-/}" || die |
94 |
xdg_desktop_database_check |
147 |
xdg_desktop_database_check |
|
|
148 |
gnome2_icon_cache_check |
95 |
xdg_mimeinfo_database_check |
149 |
xdg_mimeinfo_database_check |
96 |
} |
150 |
} |
97 |
|
151 |
|
98 |
- |
|
|
99 |
-> xdg_icon_cache_update |
152 |
-> xdg_icon_cache_update |
100 |
-- |
|
|
101 |
bin/postinst-qa-check.d/50xdg-utils | 12 ++++++------ |
153 |
bin/postinst-qa-check.d/50xdg-utils | 12 ++++++------ |
102 |
1 file changed, 6 insertions(+), 6 deletions(-) |
154 |
1 file changed, 6 insertions(+), 6 deletions(-) |