Gentoo Archives: gentoo-dev

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