Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 677776
Collapse All | Expand All

(-)a/bin/postinst-qa-check.d/50gnome2-utils (-54 lines)
Lines 1-61 Link Here
1
# check for missing calls to gnome2-utils regen functions
1
# check for missing calls to gnome2-utils regen functions
2
2
3
gnome2_icon_cache_check() {
4
	type -P gtk-update-icon-cache &>/dev/null || return
5
6
	local d f all_files=() missing
7
	for d in usr/share/icons/*/; do
8
		# gnome2_icon_cache_update updates only themes with an index
9
		[[ -f ${d}/index.theme ]] || continue
10
11
		local files=() find_args=(
12
			# gtk-update-icon-cache supports only specific file
13
			# suffixes; match that to avoid false positives
14
			'(' -name '*.png' -o -name '*.svg'
15
				-o -name '*.xpm' -o -name '*.icon' ')'
16
		)
17
		# if the cache does not exist at all, we complain for any file
18
		# otherwise, we look for files newer than the cache
19
		[[ -f ${d}/icon-theme.cache ]] &&
20
			find_args+=( -newercm "${d}"/icon-theme.cache ) || missing=1
21
22
		# (use -mindepth 2 to easily skip the cache files)
23
		while read -r -d $'\0' f; do
24
			files+=( "${f}" )
25
		done < <(find "${d}" -mindepth 2 -type f "${find_args[@]}" -print0)
26
27
		# if any files were found, update the db to avoid repeating
28
		# the warning for subsequent packages
29
		if [[ ${files[@]} ]]; then
30
			all_files+=("${files[@]}")
31
			addwrite "${d}"
32
			gtk-update-icon-cache -qf "${d}"
33
		fi
34
	done
35
36
	# preinst initializes the baseline state for the posinst check
37
	[[ ${PORTAGE_QA_PHASE} == preinst ]] && return
38
39
	# parallel-install makes it impossible to blame a specific package
40
	has parallel-install ${FEATURES} && return
41
42
	# avoid false-positives on first install (bug 649464)
43
	[[ ${PN} == gtk-update-icon-cache ]] && return
44
45
	# The eqatag call is prohibitively expensive if the cache is
46
	# missing and there are a large number of files.
47
	if [[ -z ${missing} && ${all_files[@]} ]]; then
48
		eqawarn "QA Notice: new icons were found installed but GTK+ icon cache"
49
		eqawarn "has not been updated:"
50
		eqatag -v gnome2-utils.icon-cache "${all_files[@]/#//}"
51
		eqawarn "Please make sure to call gnome2_icon_cache_update()"
52
		eqawarn "in pkg_postinst() and pkg_postrm() phases of appropriate pkgs."
53
	fi
54
}
55
56
gnome2_utils_postinst_check() {
3
gnome2_utils_postinst_check() {
57
	cd "${EROOT:-/}" || die
4
	cd "${EROOT:-/}" || die
58
	gnome2_icon_cache_check
59
}
5
}
60
6
61
gnome2_utils_postinst_check
7
gnome2_utils_postinst_check
(-)a/bin/postinst-qa-check.d/50xdg-utils (-2 / +54 lines)
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(-)
(-)a/bin/postinst-qa-check.d/50xdg-utils (-8 / +6 lines)
Lines 46-57 xdg_desktop_database_check() { Link Here
46
	fi
46
	fi
47
}
47
}
48
48
49
gnome2_icon_cache_check() {
49
xdg_icon_cache_check() {
50
	type -P gtk-update-icon-cache &>/dev/null || return
50
	type -P gtk-update-icon-cache &>/dev/null || return
51
51
52
	local d f all_files=() missing
52
	local d f all_files=() missing
53
	for d in usr/share/icons/*/; do
53
	for d in usr/share/icons/*/; do
54
		# gnome2_icon_cache_update updates only themes with an index
54
		# xdg_icon_cache_update updates only themes with an index
55
		[[ -f ${d}/index.theme ]] || continue
55
		[[ -f ${d}/index.theme ]] || continue
56
56
57
		local files=() find_args=(
57
		local files=() find_args=(
Lines 91-100 gnome2_icon_cache_check() { Link Here
91
	# The eqatag call is prohibitively expensive if the cache is
91
	# The eqatag call is prohibitively expensive if the cache is
92
	# missing and there are a large number of files.
92
	# missing and there are a large number of files.
93
	if [[ -z ${missing} && ${all_files[@]} ]]; then
93
	if [[ -z ${missing} && ${all_files[@]} ]]; then
94
		eqawarn "QA Notice: new icons were found installed but GTK+ icon cache"
94
		eqawarn "QA Notice: new icons were found installed but icon cache"
95
		eqawarn "has not been updated:"
95
		eqawarn "has not been updated:"
96
		eqatag -v gnome2-utils.icon-cache "${all_files[@]/#//}"
96
		eqatag -v xdg-utils.icon-cache "${all_files[@]/#//}"
97
		eqawarn "Please make sure to call gnome2_icon_cache_update()"
97
		eqawarn "Please make sure to call xdg_icon_cache_update()"
98
		eqawarn "in pkg_postinst() and pkg_postrm() phases of appropriate pkgs."
98
		eqawarn "in pkg_postinst() and pkg_postrm() phases of appropriate pkgs."
99
	fi
99
	fi
100
}
100
}
Lines 145-151 xdg_mimeinfo_database_check() { Link Here
145
xdg_utils_postinst_check() {
145
xdg_utils_postinst_check() {
146
	cd "${EROOT:-/}" || die
146
	cd "${EROOT:-/}" || die
147
	xdg_desktop_database_check
147
	xdg_desktop_database_check
148
	gnome2_icon_cache_check
148
	xdg_icon_cache_check
149
	xdg_mimeinfo_database_check
149
	xdg_mimeinfo_database_check
150
}
150
}
151
151
152
- 
153
files.
152
files.
154
--
155
bin/postinst-qa-check.d/50gnome2-utils | 10 ----------
153
bin/postinst-qa-check.d/50gnome2-utils | 10 ----------
156
bin/preinst-qa-check.d/50gnome2-utils  |  1 -
154
bin/preinst-qa-check.d/50gnome2-utils  |  1 -
157
2 files changed, 11 deletions(-)
155
2 files changed, 11 deletions(-)
158
delete mode 100644 bin/postinst-qa-check.d/50gnome2-utils
156
delete mode 100644 bin/postinst-qa-check.d/50gnome2-utils
159
delete mode 120000 bin/preinst-qa-check.d/50gnome2-utils
157
delete mode 120000 bin/preinst-qa-check.d/50gnome2-utils
(-)a/bin/postinst-qa-check.d/50gnome2-utils (-10 lines)
Lines 1-10 Link Here
1
# check for missing calls to gnome2-utils regen functions
2
3
gnome2_utils_postinst_check() {
4
	cd "${EROOT:-/}" || die
5
}
6
7
gnome2_utils_postinst_check
8
: # guarantee successful exit
9
10
# vim:ft=sh
(-)a/bin/preinst-qa-check.d/50gnome2-utils (-2 lines)
Line 1 Link Here
1
../postinst-qa-check.d/50gnome2-utils
2
- 

Return to bug 677776