1 |
commit: 4b9753aaa9c12b68cf646c60f028a04151860751 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 11 21:51:07 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 14 23:43:54 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b9753aa |
7 |
|
8 |
kde5.eclass: Cleanup functions rented from xdg.eclass |
9 |
|
10 |
This reverts 16e6b9bc. |
11 |
|
12 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
13 |
|
14 |
eclass/kde5.eclass | 128 +++-------------------------------------------------- |
15 |
1 file changed, 5 insertions(+), 123 deletions(-) |
16 |
|
17 |
diff --git a/eclass/kde5.eclass b/eclass/kde5.eclass |
18 |
index 82655acabcc..e3c4bc9c923 100644 |
19 |
--- a/eclass/kde5.eclass |
20 |
+++ b/eclass/kde5.eclass |
21 |
@@ -31,11 +31,10 @@ _KDE5_ECLASS=1 |
22 |
# for tests you should proceed with setting VIRTUALX_REQUIRED=test. |
23 |
: ${VIRTUALX_REQUIRED:=manual} |
24 |
|
25 |
-inherit cmake-utils flag-o-matic kde5-functions virtualx |
26 |
+inherit cmake-utils flag-o-matic kde5-functions virtualx xdg |
27 |
|
28 |
case ${EAPI} in |
29 |
- 6) inherit eapi7-ver eutils gnome2-utils xdg ;; |
30 |
- 7) inherit xdg-utils ;; |
31 |
+ 6) inherit eapi7-ver eutils gnome2-utils ;; |
32 |
esac |
33 |
|
34 |
if [[ ${KDE_BUILD_TYPE} = live ]]; then |
35 |
@@ -717,120 +716,6 @@ kde5_src_install() { |
36 |
fi |
37 |
} |
38 |
|
39 |
-# @FUNCTION: _xdg_icon_cache_update |
40 |
-# @DESCRIPTION: Forked from future xdg-utils.eclass. REMOVEME! |
41 |
-# Updates Gtk+ icon cache files under /usr/share/icons. |
42 |
-# This function should be called from pkg_postinst and pkg_postrm. |
43 |
-_xdg_icon_cache_update() { |
44 |
- if [[ ${EBUILD_PHASE} != post* ]] ; then |
45 |
- die "xdg_icon_cache_update must be used in pkg_post* phases." |
46 |
- fi |
47 |
- |
48 |
- if ! type gtk-update-icon-cache &>/dev/null; then |
49 |
- debug-print "gtk-update-icon-cache is not found" |
50 |
- return |
51 |
- fi |
52 |
- |
53 |
- ebegin "Updating icons cache" |
54 |
- local retval=0 |
55 |
- local fails=( ) |
56 |
- for dir in "${EROOT%/}"/usr/share/icons/* |
57 |
- do |
58 |
- if [[ -f "${dir}/index.theme" ]] ; then |
59 |
- local rv=0 |
60 |
- gtk-update-icon-cache -qf "${dir}" |
61 |
- rv=$? |
62 |
- if [[ ! $rv -eq 0 ]] ; then |
63 |
- debug-print "Updating cache failed on ${dir}" |
64 |
- # Add to the list of failures |
65 |
- fails+=( "${dir}" ) |
66 |
- retval=2 |
67 |
- fi |
68 |
- elif [[ $(ls "${dir}") = "icon-theme.cache" ]]; then |
69 |
- # Clear stale cache files after theme uninstallation |
70 |
- rm "${dir}/icon-theme.cache" |
71 |
- fi |
72 |
- if [[ -z $(ls "${dir}") ]]; then |
73 |
- # Clear empty theme directories after theme uninstallation |
74 |
- rmdir "${dir}" |
75 |
- fi |
76 |
- done |
77 |
- eend ${retval} |
78 |
- for f in "${fails[@]}" ; do |
79 |
- eerror "Failed to update cache with icon $f" |
80 |
- done |
81 |
-} |
82 |
- |
83 |
-# @FUNCTION: _xdg_pkg_preinst |
84 |
-# @DESCRIPTION: Forked from future xdg.eclass. REMOVEME! |
85 |
-# Finds .desktop, icon and mime info files for later handling in pkg_postinst. |
86 |
-# Locations are stored in XDG_ECLASS_DESKTOPFILES, XDG_ECLASS_ICONFILES |
87 |
-# and XDG_ECLASS_MIMEINFOFILES respectively. |
88 |
-_xdg_pkg_preinst() { |
89 |
- local f |
90 |
- |
91 |
- XDG_ECLASS_DESKTOPFILES=() |
92 |
- while IFS= read -r -d '' f; do |
93 |
- XDG_ECLASS_DESKTOPFILES+=( ${f} ) |
94 |
- done < <(cd "${ED}" && find 'usr/share/applications' -type f -print0 2>/dev/null) |
95 |
- |
96 |
- XDG_ECLASS_ICONFILES=() |
97 |
- while IFS= read -r -d '' f; do |
98 |
- XDG_ECLASS_ICONFILES+=( ${f} ) |
99 |
- done < <(cd "${ED}" && find 'usr/share/icons' -type f -print0 2>/dev/null) |
100 |
- |
101 |
- XDG_ECLASS_MIMEINFOFILES=() |
102 |
- while IFS= read -r -d '' f; do |
103 |
- XDG_ECLASS_MIMEINFOFILES+=( ${f} ) |
104 |
- done < <(cd "${ED}" && find 'usr/share/mime' -type f -print0 2>/dev/null) |
105 |
-} |
106 |
- |
107 |
-# @FUNCTION: _xdg_pkg_postinst |
108 |
-# @DESCRIPTION: Forked from future xdg.eclass. REMOVEME! |
109 |
-# Handle desktop, icon and mime info database updates. |
110 |
-_xdg_pkg_postinst() { |
111 |
- if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then |
112 |
- xdg_desktop_database_update |
113 |
- else |
114 |
- debug-print "No .desktop files to add to database" |
115 |
- fi |
116 |
- |
117 |
- if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then |
118 |
- _xdg_icon_cache_update |
119 |
- else |
120 |
- debug-print "No icon files to add to cache" |
121 |
- fi |
122 |
- |
123 |
- if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then |
124 |
- xdg_mimeinfo_database_update |
125 |
- else |
126 |
- debug-print "No mime info files to add to database" |
127 |
- fi |
128 |
-} |
129 |
- |
130 |
-# @FUNCTION: _xdg_pkg_postrm |
131 |
-# @DESCRIPTION: Forked from future xdg.eclass. REMOVEME! |
132 |
-# Handle desktop, icon and mime info database updates. |
133 |
-_xdg_pkg_postrm() { |
134 |
- if [[ ${#XDG_ECLASS_DESKTOPFILES[@]} -gt 0 ]]; then |
135 |
- xdg_desktop_database_update |
136 |
- else |
137 |
- debug-print "No .desktop files to add to database" |
138 |
- fi |
139 |
- |
140 |
- if [[ ${#XDG_ECLASS_ICONFILES[@]} -gt 0 ]]; then |
141 |
- _xdg_icon_cache_update |
142 |
- else |
143 |
- debug-print "No icon files to add to cache" |
144 |
- fi |
145 |
- |
146 |
- if [[ ${#XDG_ECLASS_MIMEINFOFILES[@]} -gt 0 ]]; then |
147 |
- xdg_mimeinfo_database_update |
148 |
- else |
149 |
- debug-print "No mime info files to add to database" |
150 |
- fi |
151 |
-} |
152 |
- |
153 |
# @FUNCTION: kde5_pkg_preinst |
154 |
# @DESCRIPTION: |
155 |
# Sets up environment variables required in kde5_pkg_postinst. |
156 |
@@ -838,8 +723,7 @@ kde5_pkg_preinst() { |
157 |
debug-print-function ${FUNCNAME} "$@" |
158 |
|
159 |
[[ ${EAPI} == 6 ]] && gnome2_icon_savelist |
160 |
- [[ ${EAPI} == 6 ]] && xdg_pkg_preinst |
161 |
- [[ ${EAPI} == 7 ]] && _xdg_pkg_preinst |
162 |
+ xdg_pkg_preinst |
163 |
} |
164 |
|
165 |
# @FUNCTION: kde5_pkg_postinst |
166 |
@@ -851,8 +735,7 @@ kde5_pkg_postinst() { |
167 |
if [[ ${EAPI} == 6 && -n ${GNOME2_ECLASS_ICONS} ]]; then |
168 |
gnome2_icon_cache_update |
169 |
fi |
170 |
- [[ ${EAPI} == 6 ]] && xdg_pkg_postinst |
171 |
- [[ ${EAPI} == 7 ]] && _xdg_pkg_postinst |
172 |
+ xdg_pkg_postinst |
173 |
|
174 |
if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then |
175 |
if [[ ${KDE_BUILD_TYPE} = live ]]; then |
176 |
@@ -873,8 +756,7 @@ kde5_pkg_postrm() { |
177 |
if [[ ${EAPI} == 6 && -n ${GNOME2_ECLASS_ICONS} ]]; then |
178 |
gnome2_icon_cache_update |
179 |
fi |
180 |
- [[ ${EAPI} == 6 ]] && xdg_pkg_postrm |
181 |
- [[ ${EAPI} == 7 ]] && _xdg_pkg_postrm |
182 |
+ xdg_pkg_postrm |
183 |
} |
184 |
|
185 |
fi |