Gentoo Archives: gentoo-dev

From: "Marty E. Plummer" <hanetzer@×××××××××.com>
To: gentoo-dev@l.g.o
Cc: "Marty E. Plummer" <hanetzer@×××××××××.com>
Subject: [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready
Date: Mon, 18 Jun 2018 00:49:01
Message-Id: 20180618004726.21235-3-hanetzer@startmail.com
In Reply to: [gentoo-dev] [PATCH 0/2] xdg-utils && gnome2-utils EAPI 7 work by "Marty E. Plummer"
1 Use ${EROOT%/} whereever possible, as most of the directories and files
2 used in conjunction with it have a leading /; add missing leading /
3 where apropriate. Put sys-apps/sed into BDEPEND if EAPI 7, as it need to
4 be executable on CBUILD.
5
6 Signed-off-by: Marty E. Plummer <hanetzer@×××××××××.com>
7 Package-Manager: Portage-2.3.40, Repoman-2.3.9
8 ---
9 eclass/gnome2-utils.eclass | 43 +++++++++++++++++++-------------------
10 1 file changed, 22 insertions(+), 21 deletions(-)
11
12 diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
13 index 65076ae2d61..4204dac2956 100644
14 --- a/eclass/gnome2-utils.eclass
15 +++ b/eclass/gnome2-utils.eclass
16 @@ -18,7 +18,7 @@
17 inherit eutils xdg-utils
18
19 case "${EAPI:-0}" in
20 - 0|1|2|3|4|5|6) ;;
21 + 0|1|2|3|4|5|6|7) ;;
22 *) die "EAPI=${EAPI} is not supported" ;;
23 esac
24
25 @@ -82,8 +82,9 @@ esac
26 # @DESCRIPTION:
27 # List of gdk-pixbuf loaders provided by the package
28
29 -DEPEND=">=sys-apps/sed-4"
30 -
31 +# sed needs to be executable on the build system
32 +BDEPEND=">=sys-apps/sed-4"
33 +[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}"
34
35 # @FUNCTION: gnome2_environment_reset
36 # @DESCRIPTION:
37 @@ -101,7 +102,7 @@ gnome2_environment_reset() {
38 # Ensure we don't rely on dconf/gconf while building, bug #511946
39 export GSETTINGS_BACKEND="memory"
40
41 - if has ${EAPI:-0} 6; then
42 + if has ${EAPI:-0} 6 7; then
43 # Try to cover the packages honoring this variable, bug #508124
44 export GST_INSPECT="$(type -P true)"
45
46 @@ -129,7 +130,7 @@ gnome2_gconf_savelist() {
47 # This function should be called from pkg_postinst.
48 gnome2_gconf_install() {
49 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
50 - local updater="${EROOT}${GCONFTOOL_BIN}"
51 + local updater="${EROOT%/}${GCONFTOOL_BIN}"
52
53 if [[ ! -x "${updater}" ]]; then
54 debug-print "${updater} is not executable"
55 @@ -149,9 +150,9 @@ gnome2_gconf_install() {
56
57 local F
58 for F in ${GNOME2_ECLASS_SCHEMAS}; do
59 - if [[ -e "${EROOT}${F}" ]]; then
60 + if [[ -e "${EROOT%/}${F}" ]]; then
61 debug-print "Installing schema: ${F}"
62 - "${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
63 + "${updater}" --makefile-install-rule "${EROOT%/}${F}" 1>/dev/null
64 fi
65 done
66
67 @@ -170,7 +171,7 @@ gnome2_gconf_install() {
68 # database.
69 gnome2_gconf_uninstall() {
70 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
71 - local updater="${EROOT}${GCONFTOOL_BIN}"
72 + local updater="${EROOT%/}${GCONFTOOL_BIN}"
73
74 if [[ ! -x "${updater}" ]]; then
75 debug-print "${updater} is not executable"
76 @@ -189,9 +190,9 @@ gnome2_gconf_uninstall() {
77
78 local F
79 for F in ${GNOME2_ECLASS_SCHEMAS}; do
80 - if [[ -e "${EROOT}${F}" ]]; then
81 + if [[ -e "${EROOT%/}${F}" ]]; then
82 debug-print "Uninstalling gconf schema: ${F}"
83 - "${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
84 + "${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 1>/dev/null
85 fi
86 done
87
88 @@ -224,7 +225,7 @@ gnome2_icon_savelist() {
89 # This function should be called from pkg_postinst and pkg_postrm.
90 gnome2_icon_cache_update() {
91 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
92 - local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
93 + local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
94
95 if [[ ! -x "${updater}" ]] ; then
96 debug-print "${updater} is not executable"
97 @@ -339,7 +340,7 @@ gnome2_scrollkeeper_savelist() {
98 # This function should be called from pkg_postinst and pkg_postrm.
99 gnome2_scrollkeeper_update() {
100 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
101 - local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
102 + local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
103
104 if [[ ! -x "${updater}" ]] ; then
105 debug-print "${updater} is not executable"
106 @@ -352,7 +353,7 @@ gnome2_scrollkeeper_update() {
107 fi
108
109 ebegin "Updating scrollkeeper database ..."
110 - "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
111 + "${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
112 eend $?
113 }
114
115 @@ -376,7 +377,7 @@ gnome2_schemas_savelist() {
116 # This function should be called from pkg_postinst and pkg_postrm.
117 gnome2_schemas_update() {
118 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
119 - local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
120 + local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
121
122 if [[ ! -x ${updater} ]]; then
123 debug-print "${updater} is not executable"
124 @@ -407,10 +408,10 @@ gnome2_gdk_pixbuf_savelist() {
125 # This function should be called from pkg_postinst and pkg_postrm.
126 gnome2_gdk_pixbuf_update() {
127 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
128 - local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
129 + local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
130
131 if [[ ! -x ${updater} ]]; then
132 - updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
133 + updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
134 fi
135
136 if [[ ! -x ${updater} ]]; then
137 @@ -427,7 +428,7 @@ gnome2_gdk_pixbuf_update() {
138 local tmp_file=$(emktemp)
139 ${updater} 1> "${tmp_file}" &&
140 chmod 0644 "${tmp_file}" &&
141 - cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
142 + cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
143 rm "${tmp_file}" # don't replace this with mv, required for SELinux support
144 eend $?
145 }
146 @@ -441,7 +442,7 @@ gnome2_query_immodules_gtk2() {
147 [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
148
149 ebegin "Updating gtk2 input method module cache"
150 - GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
151 + GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
152 "${updater}" --update-cache
153 eend $?
154 }
155 @@ -455,7 +456,7 @@ gnome2_query_immodules_gtk3() {
156 [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
157
158 ebegin "Updating gtk3 input method module cache"
159 - GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
160 + GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
161 "${updater}" --update-cache
162 eend $?
163 }
164 @@ -467,10 +468,10 @@ gnome2_query_immodules_gtk3() {
165 # This function should be called from pkg_postinst and pkg_postrm.
166 gnome2_giomodule_cache_update() {
167 has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
168 - local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
169 + local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
170
171 if [[ ! -x ${updater} ]]; then
172 - updater="${EROOT}/usr/bin/gio-querymodules"
173 + updater="${EROOT%/}/usr/bin/gio-querymodules"
174 fi
175
176 if [[ ! -x ${updater} ]]; then
177 --
178 2.17.1

Replies