* [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
@ 2013-08-31 11:07 Gilles Dartiguelongue
2013-08-31 11:40 ` Michał Górny
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-08-31 11:07 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
As described here:
https://bugs.gentoo.org/show_bug.cgi?id=483128
This is a very lightweight patch to support the few packages that
provide gdk pixbuf loaders. The ones I know of are: gdk-pixbuf itself,
librsvg and libopenraw and emul-gtklibs but more could be missing simply
because they do not run the command.
Since this patch is quite trivial, I'd like to have it commited by
Sunday. Thanks.
I am attaching the patch here as well for convience.
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: gdk-pixbuf-cache.patch --]
[-- Type: text/x-patch, Size: 3080 bytes --]
Index: gnome2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v
retrieving revision 1.122
diff -u -B -r1.122 gnome2.eclass
--- gnome2.eclass 26 May 2013 14:08:21 -0000 1.122
+++ gnome2.eclass 31 Aug 2013 10:56:58 -0000
@@ -258,6 +258,7 @@
gnome2_icon_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
+ gnome2_gdk_pixbuf_savelist
}
# @FUNCTION: gnome2_pkg_postinst
@@ -271,6 +272,7 @@
gnome2_icon_cache_update
gnome2_schemas_update
gnome2_scrollkeeper_update
+ gnome2_gdk_pixbuf_update
}
# # FIXME Handle GConf schemas removal
Index: gnome2-utils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v
retrieving revision 1.31
diff -u -B -r1.31 gnome2-utils.eclass
--- gnome2-utils.eclass 27 Oct 2012 22:24:10 -0000 1.31
+++ gnome2-utils.eclass 31 Aug 2013 10:56:58 -0000
@@ -50,6 +50,12 @@
# Path to glib-compile-schemas
: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
+# @ECLASS-VARIABLE: GDK_PIXBUF_UPDATE_BIN
+# @INTERNAL
+# @DESCRIPTION:
+# Path to gdk-pixbuf-query-loaders
+: ${GDK_PIXBUF_UPDATE_BIN:="/usr/bin/gdk-pixbuf-query-loaders"}
+
# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS
# @INTERNAL
# @DEFAULT_UNSET
@@ -74,6 +80,12 @@
# @DESCRIPTION:
# List of GSettings schemas provided by the package
+# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
+# @INTERNAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# List of gdk-pixbuf loaders provided by the package
+
DEPEND=">=sys-apps/sed-4"
@@ -387,6 +399,45 @@
eend $?
}
+# @FUNCTION: gnome2_gdk_pixbuf_savelist
+# @DESCRIPTION:
+# Find if there is any gdk-pixbuf loader to install and save the list in
+# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
+# This function should be called from pkg_preinst.
+gnome2_gdk_pixbuf_savelist() {
+ has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
+ pushd "${ED}" &>/dev/null
+ export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find "usr/$(get_libdir)/gdk-pixbuf-2.0" -type f 2>/dev/null)
+ popd &>/dev/null
+}
+
+# @FUNCTION: gnome2_gdk_pixbuf_update
+# @USAGE: gnome2_gdk_pixbuf_update
+# @DESCRIPTION:
+# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
+# This function should be called from pkg_postinst and pkg_postrm.
+gnome2_gdk_pixbuf_update() {
+ has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
+ local updater="${EROOT}${GDK_PIXBUF_UPDATE_BIN}"
+
+ if [[ ! -x ${updater} ]]; then
+ debug-print "${updater} is not executable"
+ return
+ fi
+
+ if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
+ debug-print "gdk-pixbuf loader cache does not need an update"
+ return
+ fi
+
+ ebegin "Updating gdk-pixbuf loader cache"
+ local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf)
+ ${updater} 1> "${tmp_file}" 2>/dev/null &&
+ cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
+ eend $?
+}
+
+
# @FUNCTION: gnome2_query_immodules_gtk2
# @USAGE: gnome2_query_immodules_gtk2
# @DESCRIPTION:
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-08-31 11:07 [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update Gilles Dartiguelongue
@ 2013-08-31 11:40 ` Michał Górny
2013-08-31 13:00 ` Gilles Dartiguelongue
0 siblings, 1 reply; 26+ messages in thread
From: Michał Górny @ 2013-08-31 11:40 UTC (permalink / raw
To: gentoo-dev; +Cc: eva
[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]
Dnia 2013-08-31, o godz. 13:07:41
Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
> +# @FUNCTION: gnome2_gdk_pixbuf_savelist
> +# @DESCRIPTION:
> +# Find if there is any gdk-pixbuf loader to install and save the list in
> +# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
> +# This function should be called from pkg_preinst.
> +gnome2_gdk_pixbuf_savelist() {
> + has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
> + pushd "${ED}" &>/dev/null
pushd "${ED}" >/dev/null || die
(don't hide errors)
> + export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find "usr/$(get_libdir)/gdk-pixbuf-2.0" -type f 2>/dev/null)
> + popd &>/dev/null
> +}
> +
> +# @FUNCTION: gnome2_gdk_pixbuf_update
> +# @USAGE: gnome2_gdk_pixbuf_update
> +# @DESCRIPTION:
> +# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
> +# This function should be called from pkg_postinst and pkg_postrm.
> +gnome2_gdk_pixbuf_update() {
> + has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> + local updater="${EROOT}${GDK_PIXBUF_UPDATE_BIN}"
> +
> + if [[ ! -x ${updater} ]]; then
> + debug-print "${updater} is not executable"
> + return
> + fi
> +
> + if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
> + debug-print "gdk-pixbuf loader cache does not need an update"
> + return
> + fi
> +
> + ebegin "Updating gdk-pixbuf loader cache"
> + local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf)
> + ${updater} 1> "${tmp_file}" 2>/dev/null &&
Why do you hide errors from user? '[FAIL]' with no explanation doesn't
seem really helpeful.
> + cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
Why not mv or cp? Also you need '|| die' here since 'cat' can fail
writing.
Is it safe to assume constant '2.10.0'?
> + eend $?
> +}
> +
> +
> # @FUNCTION: gnome2_query_immodules_gtk2
> # @USAGE: gnome2_query_immodules_gtk2
> # @DESCRIPTION:
Also, please make 'loaders.cache' owned by x11-libs/gdk-pixbuf.
And please ensure to remove it in pkg_postrm() when last version
of gdk-pixbuf is unmerged.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-08-31 11:40 ` Michał Górny
@ 2013-08-31 13:00 ` Gilles Dartiguelongue
2013-08-31 13:30 ` Alex Xu
2013-08-31 14:49 ` Michał Górny
0 siblings, 2 replies; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-08-31 13:00 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 2695 bytes --]
Le samedi 31 août 2013 à 13:40 +0200, Michał Górny a écrit :
> Dnia 2013-08-31, o godz. 13:07:41
> Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
>
> > +# @FUNCTION: gnome2_gdk_pixbuf_savelist
> > +# @DESCRIPTION:
> > +# Find if there is any gdk-pixbuf loader to install and save the list in
> > +# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
> > +# This function should be called from pkg_preinst.
> > +gnome2_gdk_pixbuf_savelist() {
> > + has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
> > + pushd "${ED}" &>/dev/null
>
> pushd "${ED}" >/dev/null || die
>
> (don't hide errors)
ok, I'll check all other usage in gnome eclasses.
> > + export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find "usr/$(get_libdir)/gdk-pixbuf-2.0" -type f 2>/dev/null)
> > + popd &>/dev/null
> > +}
> > +
> > +# @FUNCTION: gnome2_gdk_pixbuf_update
> > +# @USAGE: gnome2_gdk_pixbuf_update
> > +# @DESCRIPTION:
> > +# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
> > +# This function should be called from pkg_postinst and pkg_postrm.
> > +gnome2_gdk_pixbuf_update() {
> > + has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
> > + local updater="${EROOT}${GDK_PIXBUF_UPDATE_BIN}"
> > +
> > + if [[ ! -x ${updater} ]]; then
> > + debug-print "${updater} is not executable"
> > + return
> > + fi
> > +
> > + if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
> > + debug-print "gdk-pixbuf loader cache does not need an update"
> > + return
> > + fi
> > +
> > + ebegin "Updating gdk-pixbuf loader cache"
> > + local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf)
> > + ${updater} 1> "${tmp_file}" 2>/dev/null &&
>
> Why do you hide errors from user? '[FAIL]' with no explanation doesn't
> seem really helpeful.
True.
> > + cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
>
> Why not mv or cp? Also you need '|| die' here since 'cat' can fail
> writing.
I'd have to look back at the original bug report to get the exact reason
but it seems mv/cp was not atomic enough.
> Is it safe to assume constant '2.10.0'?
afaik yes, it's not changed in ages.
> > + eend $?
> > +}
> > +
> > +
> > # @FUNCTION: gnome2_query_immodules_gtk2
> > # @USAGE: gnome2_query_immodules_gtk2
> > # @DESCRIPTION:
>
> Also, please make 'loaders.cache' owned by x11-libs/gdk-pixbuf.
Yes, we need to work on that for all other caches as well.
> And please ensure to remove it in pkg_postrm() when last version
> of gdk-pixbuf is unmerged.
I am not clear on this last sentence. Could you reformulate it please ?
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-08-31 13:00 ` Gilles Dartiguelongue
@ 2013-08-31 13:30 ` Alex Xu
2013-08-31 14:49 ` Michał Górny
1 sibling, 0 replies; 26+ messages in thread
From: Alex Xu @ 2013-08-31 13:30 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 360 bytes --]
On 31/08/13 09:00 AM, Gilles Dartiguelongue wrote:
>> > And please ensure to remove it in pkg_postrm() when last version
>> > of gdk-pixbuf is unmerged.
> I am not clear on this last sentence. Could you reformulate it please ?
Ensure that the loaders.cache file is removed correctly when all
versions of gdk-pixbuf have been removed from the system.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-08-31 13:00 ` Gilles Dartiguelongue
2013-08-31 13:30 ` Alex Xu
@ 2013-08-31 14:49 ` Michał Górny
2013-08-31 16:44 ` Gilles Dartiguelongue
1 sibling, 1 reply; 26+ messages in thread
From: Michał Górny @ 2013-08-31 14:49 UTC (permalink / raw
To: gentoo-dev; +Cc: eva
[-- Attachment #1: Type: text/plain, Size: 1070 bytes --]
Dnia 2013-08-31, o godz. 15:00:43
Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
> Le samedi 31 août 2013 à 13:40 +0200, Michał Górny a écrit :
> > > + cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
> >
> > Why not mv or cp? Also you need '|| die' here since 'cat' can fail
> > writing.
>
> I'd have to look back at the original bug report to get the exact reason
> but it seems mv/cp was not atomic enough.
Well, 'cat' is not atomic at all, so definitely not that :). 'mv' is
the only command that you can expect to at least try to be atomic.
It may had something to do with file metadata or symlinks.
> > And please ensure to remove it in pkg_postrm() when last version
> > of gdk-pixbuf is unmerged.
>
> I am not clear on this last sentence. Could you reformulate it please ?
In gdk-pixbuf, something like:
pkg_postrm() {
# TODO: check if i used the correct variable :)
[[ ${REPLACING_VERSIONS} ]] || rm -f "${EROOT}"usr/.../loaders.cache
}
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-08-31 14:49 ` Michał Górny
@ 2013-08-31 16:44 ` Gilles Dartiguelongue
2013-09-01 11:29 ` Gilles Dartiguelongue
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-08-31 16:44 UTC (permalink / raw
To: gentoo-dev; +Cc: lxnay
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
Le samedi 31 août 2013 à 16:49 +0200, Michał Górny a écrit :
> Dnia 2013-08-31, o godz. 15:00:43
> Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
>
> > Le samedi 31 août 2013 à 13:40 +0200, Michał Górny a écrit :
> > > > + cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
> > >
> > > Why not mv or cp? Also you need '|| die' here since 'cat' can fail
> > > writing.
> >
> > I'd have to look back at the original bug report to get the exact reason
> > but it seems mv/cp was not atomic enough.
>
> Well, 'cat' is not atomic at all, so definitely not that :). 'mv' is
> the only command that you can expect to at least try to be atomic.
>
> It may had something to do with file metadata or symlinks.
I sort of remember there was a bug report but I can find no trace of it.
All I could find was the commit that introduced this logic, by lxnay:
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.24.0.ebuild?hideattic=0&revision=1.2&view=markup
@lxnay, could you please comment on previous question ?
> > > And please ensure to remove it in pkg_postrm() when last version
> > > of gdk-pixbuf is unmerged.
> >
> > I am not clear on this last sentence. Could you reformulate it please ?
>
> In gdk-pixbuf, something like:
>
> pkg_postrm() {
> # TODO: check if i used the correct variable :)
> [[ ${REPLACING_VERSIONS} ]] || rm -f "${EROOT}"usr/.../loaders.cache
> }
>
ok, will do.
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-08-31 16:44 ` Gilles Dartiguelongue
@ 2013-09-01 11:29 ` Gilles Dartiguelongue
2013-09-01 12:11 ` Michał Górny
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-09-01 11:29 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]
Le samedi 31 août 2013 à 18:44 +0200, Gilles Dartiguelongue a écrit :
> Le samedi 31 août 2013 à 16:49 +0200, Michał Górny a écrit :
> > Dnia 2013-08-31, o godz. 15:00:43
> > Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
> >
> > > Le samedi 31 août 2013 à 13:40 +0200, Michał Górny a écrit :
> > > > > + cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
> > > >
> > > > Why not mv or cp? Also you need '|| die' here since 'cat' can fail
> > > > writing.
Thanks for pacho's bugzillafu, we've got the original reports here:
https://bugs.gentoo.org/show_bug.cgi?id=413529
https://bugs.gentoo.org/show_bug.cgi?id=413485
It seems the cat usage was only to avoid handling file permission
issues.
The use of a temporary file itself it to avoid having a corrupted file
if the command fails.
As for immodules I plan to provide patches to fix it after we agree on
this one.
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-01 11:29 ` Gilles Dartiguelongue
@ 2013-09-01 12:11 ` Michał Górny
2013-09-01 15:10 ` Gilles Dartiguelongue
0 siblings, 1 reply; 26+ messages in thread
From: Michał Górny @ 2013-09-01 12:11 UTC (permalink / raw
To: gentoo-dev; +Cc: eva
[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]
Dnia 2013-09-01, o godz. 13:29:27
Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
>
> Le samedi 31 août 2013 à 18:44 +0200, Gilles Dartiguelongue a écrit :
> > Le samedi 31 août 2013 à 16:49 +0200, Michał Górny a écrit :
> > > Dnia 2013-08-31, o godz. 15:00:43
> > > Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
> > >
> > > > Le samedi 31 août 2013 à 13:40 +0200, Michał Górny a écrit :
> > > > > > + cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
> > > > >
> > > > > Why not mv or cp? Also you need '|| die' here since 'cat' can fail
> > > > > writing.
>
> Thanks for pacho's bugzillafu, we've got the original reports here:
>
> https://bugs.gentoo.org/show_bug.cgi?id=413529
> https://bugs.gentoo.org/show_bug.cgi?id=413485
>
> It seems the cat usage was only to avoid handling file permission
> issues.
Then I guess using 'chmod' on the temporary file + 'mv' afterwards.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-01 12:11 ` Michał Górny
@ 2013-09-01 15:10 ` Gilles Dartiguelongue
2013-09-04 18:57 ` Gilles Dartiguelongue
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-09-01 15:10 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 118 bytes --]
Updated diffs + gdk-pixbuf handling.
Tested with success locally.
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: gdk-pixbuf-cache.patch --]
[-- Type: text/x-patch, Size: 3305 bytes --]
Index: gnome2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v
retrieving revision 1.122
diff -u -B -r1.122 gnome2.eclass
--- gnome2.eclass 26 May 2013 14:08:21 -0000 1.122
+++ gnome2.eclass 1 Sep 2013 15:04:58 -0000
@@ -258,6 +258,7 @@
gnome2_icon_savelist
gnome2_schemas_savelist
gnome2_scrollkeeper_savelist
+ gnome2_gdk_pixbuf_savelist
}
# @FUNCTION: gnome2_pkg_postinst
@@ -271,6 +272,7 @@
gnome2_icon_cache_update
gnome2_schemas_update
gnome2_scrollkeeper_update
+ gnome2_gdk_pixbuf_update
}
# # FIXME Handle GConf schemas removal
Index: gnome2-utils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v
retrieving revision 1.31
diff -u -B -r1.31 gnome2-utils.eclass
--- gnome2-utils.eclass 27 Oct 2012 22:24:10 -0000 1.31
+++ gnome2-utils.eclass 1 Sep 2013 15:04:58 -0000
@@ -15,6 +15,8 @@
# * GConf schemas management
# * scrollkeeper (old Gnome help system) management
+inherit multilib
+
case "${EAPI:-0}" in
0|1|2|3|4|5) ;;
*) die "EAPI=${EAPI} is not supported" ;;
@@ -50,6 +52,12 @@
# Path to glib-compile-schemas
: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
+# @ECLASS-VARIABLE: GDK_PIXBUF_UPDATE_BIN
+# @INTERNAL
+# @DESCRIPTION:
+# Path to gdk-pixbuf-query-loaders
+: ${GDK_PIXBUF_UPDATE_BIN:="/usr/bin/gdk-pixbuf-query-loaders"}
+
# @ECLASS-VARIABLE: GNOME2_ECLASS_SCHEMAS
# @INTERNAL
# @DEFAULT_UNSET
@@ -74,6 +82,12 @@
# @DESCRIPTION:
# List of GSettings schemas provided by the package
+# @ECLASS-VARIABLE: GNOME2_ECLASS_GDK_PIXBUF_LOADERS
+# @INTERNAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# List of gdk-pixbuf loaders provided by the package
+
DEPEND=">=sys-apps/sed-4"
@@ -387,6 +401,46 @@
eend $?
}
+# @FUNCTION: gnome2_gdk_pixbuf_savelist
+# @DESCRIPTION:
+# Find if there is any gdk-pixbuf loader to install and save the list in
+# GNOME2_ECLASS_GDK_PIXBUF_LOADERS variable.
+# This function should be called from pkg_preinst.
+gnome2_gdk_pixbuf_savelist() {
+ has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
+ pushd "${ED}" 1>/dev/null
+ export GNOME2_ECLASS_GDK_PIXBUF_LOADERS=$(find "usr/$(get_libdir)/gdk-pixbuf-2.0" -type f 2>/dev/null)
+ popd 1>/dev/null
+}
+
+# @FUNCTION: gnome2_gdk_pixbuf_update
+# @USAGE: gnome2_gdk_pixbuf_update
+# @DESCRIPTION:
+# Updates gdk-pixbuf loader cache if GNOME2_ECLASS_GDK_PIXBUF_LOADERS has some.
+# This function should be called from pkg_postinst and pkg_postrm.
+gnome2_gdk_pixbuf_update() {
+ has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
+ local updater="${EROOT}${GDK_PIXBUF_UPDATE_BIN}"
+
+ if [[ ! -x ${updater} ]]; then
+ debug-print "${updater} is not executable"
+ return
+ fi
+
+ if [[ -z ${GNOME2_ECLASS_GDK_PIXBUF_LOADERS} ]]; then
+ debug-print "gdk-pixbuf loader cache does not need an update"
+ return
+ fi
+
+ ebegin "Updating gdk-pixbuf loader cache"
+ local tmp_file=$(mktemp -t tmp.XXXXXXXXXX_gdkpixbuf)
+ ${updater} 1> "${tmp_file}" &&
+ chmod 0644 "${tmp_file}" &&
+ mv -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
+ eend $?
+}
+
+
# @FUNCTION: gnome2_query_immodules_gtk2
# @USAGE: gnome2_query_immodules_gtk2
# @DESCRIPTION:
[-- Attachment #3: gdk-pixbuf-2.28.2.ebuild.patch --]
[-- Type: text/x-patch, Size: 1579 bytes --]
Index: gdk-pixbuf-2.28.2.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.28.2.ebuild,v
retrieving revision 1.2
diff -u -B -r1.2 gdk-pixbuf-2.28.2.ebuild
--- gdk-pixbuf-2.28.2.ebuild 5 Aug 2013 09:48:12 -0000 1.2
+++ gdk-pixbuf-2.28.2.ebuild 1 Sep 2013 15:09:12 -0000
@@ -3,7 +3,8 @@
# $Header: /var/cvsroot/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.28.2.ebuild,v 1.2 2013/08/05 09:48:12 ssuominen Exp $
EAPI="5"
-inherit gnome.org multilib libtool
+
+inherit gnome.org gnome2-utils multilib libtool
DESCRIPTION="Image loading library for GTK+"
HOMEPAGE="http://www.gtk.org/"
@@ -64,19 +65,15 @@
prune_libtool_files --modules
}
+pkg_preinst() {
+ gnome2_gdk_pixbuf_savelist
+}
+
pkg_postinst() {
# causes segfault if set, see bug 375615
unset __GL_NO_DSO_FINALIZER
- tmp_file=$(mktemp -t tmp_gdk_pixbuf_ebuild.XXXXXXXXXX)
- # be atomic!
- gdk-pixbuf-query-loaders > "${tmp_file}"
- if [ "${?}" = "0" ]; then
- cat "${tmp_file}" > "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache"
- else
- ewarn "Cannot update loaders.cache, gdk-pixbuf-query-loaders failed to run"
- fi
- rm "${tmp_file}"
+ gnome2_gdk_pixbuf_update
# FIXME: use subslots to get rebuilds when really needed
# Every major version bump???
@@ -86,3 +83,9 @@
elog "emerge -va1 \$(qfile -qC ${EPREFIX}/usr/lib/gtk-2.0/2.*/loaders)"
fi
}
+
+pkg_postrm() {
+ if [[ -z ${REPLACED_BY_VERSIONS} ]]; then
+ rm -f "${EROOT}"usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache
+ fi
+}
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-01 15:10 ` Gilles Dartiguelongue
@ 2013-09-04 18:57 ` Gilles Dartiguelongue
2013-09-04 19:23 ` Ian Stakenvicius
2013-09-04 19:56 ` Michał Górny
0 siblings, 2 replies; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-09-04 18:57 UTC (permalink / raw
To: gentoo-dev
One last point to handle, how to migrate gdk-pixbuf.cache so that it is
owned by the ebuild ?
I've discussed this with Michał and it seems two options are possible.
1. rm the file on the filesystem in pkg_preinst in gdk-pixbuf ebuild
pros:
- works immediately without fiddling with profiles (see 2)
cons:
- no idea what PMS says about it, Michał told me it shouldn't work yet
my testing proves otherwise.
- leaves the system with no loaders.cache for a while which could
result in apps starting with no lots of missing icons.
2. use COLLISION_IGNORE in profiles/base/make.conf
pros:
- does not leave the system without the cache file
cons:
- add a setting to base/make.conf for a long period of time to ensure
most of our user have migrated (how long would it be btw, 6 months, 1
year ?)
- does not protect other packages from owning the package due to this
very solution for the time the setting is left in base/make.conf
3. write a news item and let users handle it
Is there any other solution or is there any other point that would move
the balance from one solution to another ?
This solution would also be applied to a couple of other commonly
regenerated files in Gnome ebuilds, like gtk-icon-cache, etc.
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 18:57 ` Gilles Dartiguelongue
@ 2013-09-04 19:23 ` Ian Stakenvicius
2013-09-04 19:44 ` Gilles Dartiguelongue
2013-09-04 19:56 ` Michał Górny
1 sibling, 1 reply; 26+ messages in thread
From: Ian Stakenvicius @ 2013-09-04 19:23 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 04/09/13 02:57 PM, Gilles Dartiguelongue wrote:
> One last point to handle, how to migrate gdk-pixbuf.cache so that
> it is owned by the ebuild ?
>
> I've discussed this with Michał and it seems two options are
> possible.
>
> 1. rm the file on the filesystem in pkg_preinst in gdk-pixbuf
> ebuild pros: - works immediately without fiddling with profiles
> (see 2) cons: - no idea what PMS says about it, Michał told me it
> shouldn't work yet my testing proves otherwise. - leaves the system
> with no loaders.cache for a while which could result in apps
> starting with no lots of missing icons.
>
> 2. use COLLISION_IGNORE in profiles/base/make.conf pros: - does not
> leave the system without the cache file cons: - add a setting to
> base/make.conf for a long period of time to ensure most of our user
> have migrated (how long would it be btw, 6 months, 1 year ?) - does
> not protect other packages from owning the package due to this very
> solution for the time the setting is left in base/make.conf
>
> 3. write a news item and let users handle it
>
>
> Is there any other solution or is there any other point that would
> move the balance from one solution to another ?
>
> This solution would also be applied to a couple of other commonly
> regenerated files in Gnome ebuilds, like gtk-icon-cache, etc.
>
By gdk-pixbuf.cache , you mean the 'loaders.cache' file that the
eclass is now continuously updating? Which ebuild is going to 'own' it?
Also, is it owned by anything right now? IIRC we don't try
particularly hard to support FEATURES="collision-protect" in the tree,
but rather FEATURES="protect-owned", and so if the file is currently
sitting there unowned by any package, afaik you shouldn't get any
collisions by installing over it.
If you want to do that *and* maintain whatever is currently in that
file, you can use the trick sys-apps/openrc used to do: in
pkg_preinst, copy the system file (if it exists) into ${D}, and then
let that same copy be merged back into the system. Openrc did it to
get around CONFIG_PROTECT, but it had the unfortunate side effect of
making the package own the file. I don't know if removal will be
affected by this though if the contents of the file change after the
ebuild owning it was merged?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
iF4EAREIAAYFAlIniLAACgkQ2ugaI38ACPA1gwD/ZRbX/aD+S/SOMHrvPsKJ6S7/
0Dvyq7FDPGpVwPXPLIAA/iYpLP4SbLowsFqGWOhyNB6FdAS93TOmoy5MNKHddocc
=9Xqu
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 19:23 ` Ian Stakenvicius
@ 2013-09-04 19:44 ` Gilles Dartiguelongue
2013-09-04 19:48 ` Ian Stakenvicius
2013-09-04 20:07 ` Zac Medico
0 siblings, 2 replies; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-09-04 19:44 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1895 bytes --]
Le mercredi 04 septembre 2013 à 15:23 -0400, Ian Stakenvicius a écrit :
> On 04/09/13 02:57 PM, Gilles Dartiguelongue wrote:
[snip]
> > Is there any other solution or is there any other point that would
> > move the balance from one solution to another ?
> >
> > This solution would also be applied to a couple of other commonly
> > regenerated files in Gnome ebuilds, like gtk-icon-cache, etc.
> >
>
> By gdk-pixbuf.cache , you mean the 'loaders.cache' file that the
> eclass is now continuously updating? Which ebuild is going to 'own' it?
yes, gdk-pixbuf is going to own it since it is the main loader provider
and the package that provides the tool to generate the cache.
> Also, is it owned by anything right now? IIRC we don't try
> particularly hard to support FEATURES="collision-protect" in the tree,
> but rather FEATURES="protect-owned", and so if the file is currently
> sitting there unowned by any package, afaik you shouldn't get any
> collisions by installing over it.
it is not owned by any package right now but touching the file in
src_install made collision-protect abort the install.
> If you want to do that *and* maintain whatever is currently in that
> file, you can use the trick sys-apps/openrc used to do: in
> pkg_preinst, copy the system file (if it exists) into ${D}, and then
> let that same copy be merged back into the system. Openrc did it to
> get around CONFIG_PROTECT, but it had the unfortunate side effect of
> making the package own the file. I don't know if removal will be
> affected by this though if the contents of the file change after the
> ebuild owning it was merged?
That sounds like a good idea, I guess it does not cause a
collision-protect error because the file is added to ${D} after
comparison between ${D} and live file-system ?
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 19:44 ` Gilles Dartiguelongue
@ 2013-09-04 19:48 ` Ian Stakenvicius
2013-09-04 19:49 ` Ian Stakenvicius
2013-09-04 20:19 ` Gilles Dartiguelongue
2013-09-04 20:07 ` Zac Medico
1 sibling, 2 replies; 26+ messages in thread
From: Ian Stakenvicius @ 2013-09-04 19:48 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 04/09/13 03:44 PM, Gilles Dartiguelongue wrote:
> Le mercredi 04 septembre 2013 à 15:23 -0400, Ian Stakenvicius a
> écrit : [snip]
>>
>> By gdk-pixbuf.cache , you mean the 'loaders.cache' file that the
>> eclass is now continuously updating? Which ebuild is going to
>> 'own' it?
>
> yes, gdk-pixbuf is going to own it since it is the main loader
> provider and the package that provides the tool to generate the
> cache.
>
>> Also, is it owned by anything right now? IIRC we don't try
>> particularly hard to support FEATURES="collision-protect" in the
>> tree, but rather FEATURES="protect-owned", and so if the file is
>> currently sitting there unowned by any package, afaik you
>> shouldn't get any collisions by installing over it.
>
> it is not owned by any package right now but touching the file in
> src_install made collision-protect abort the install.
You had FEATURES="collision-protect" enabled" or the default
FEATURES="protect-owned" ?
>
>> If you want to do that *and* maintain whatever is currently in
>> that file, you can use the trick sys-apps/openrc used to do: in
>> pkg_preinst, copy the system file (if it exists) into ${D}, and
>> then let that same copy be merged back into the system. Openrc
>> did it to get around CONFIG_PROTECT, but it had the unfortunate
>> side effect of making the package own the file. I don't know if
>> removal will be affected by this though if the contents of the
>> file change after the ebuild owning it was merged?
>
> That sounds like a good idea, I guess it does not cause a
> collision-protect error because the file is added to ${D} after
> comparison between ${D} and live file-system ?
>
No, it still does collide that first time if
FEATURES="collision-protect" is enabled. In fact, I do not believe
there is (by design) any way for this ebuild to 'take ownership' of a
file it doesn't already own without user intervention, if
FEATURES="collision-protect" is enabled.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
iF4EAREIAAYFAlInjogACgkQ2ugaI38ACPBzyQD9E6d71+zINTn6GWPPmOJHJL0I
K4IWNlanJJVE5WNpypkA/1bB1iYGQuVZIok1IssaGinme1FyJeUnDHy9PaXQTdTt
=sPlK
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 19:48 ` Ian Stakenvicius
@ 2013-09-04 19:49 ` Ian Stakenvicius
2013-09-04 20:19 ` Gilles Dartiguelongue
1 sibling, 0 replies; 26+ messages in thread
From: Ian Stakenvicius @ 2013-09-04 19:49 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 04/09/13 03:48 PM, Ian Stakenvicius wrote:
> No, it still does collide that first time if
> FEATURES="collision-protect" is enabled. In fact, I do not
> believe there is (by design) any way for this ebuild to 'take
> ownership' of a file it doesn't already own without user
> intervention, if FEATURES="collision-protect" is enabled.
>
that is, the COLLISION_IGNORE option in the profile is the only way to
do this.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
iF4EAREIAAYFAlInjs4ACgkQ2ugaI38ACPD3GwEAhRAvZRTLrDgP2q8rr2gkAPPA
j4px+1xgBjsmDVa1JzoBAJsxHUPRnorS2Je76ulN9G1y5q89MoiB+PzzYFw1ibh/
=isxn
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 18:57 ` Gilles Dartiguelongue
2013-09-04 19:23 ` Ian Stakenvicius
@ 2013-09-04 19:56 ` Michał Górny
1 sibling, 0 replies; 26+ messages in thread
From: Michał Górny @ 2013-09-04 19:56 UTC (permalink / raw
To: gentoo-dev; +Cc: eva
[-- Attachment #1: Type: text/plain, Size: 1307 bytes --]
Dnia 2013-09-04, o godz. 20:57:41
Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
> One last point to handle, how to migrate gdk-pixbuf.cache so that it is
> owned by the ebuild ?
>
> I've discussed this with Michał and it seems two options are possible.
>
> 1. rm the file on the filesystem in pkg_preinst in gdk-pixbuf ebuild
> pros:
> - works immediately without fiddling with profiles (see 2)
Except when it doesn't ;).
> cons:
> - no idea what PMS says about it, Michał told me it shouldn't work yet
> my testing proves otherwise.
PMS doesn't cover collision-protect at all. It's purely portage
feature, and at the time I played with twisted portage still complained
before pkg_preinst().
> 2. use COLLISION_IGNORE in profiles/base/make.conf
> pros:
> - does not leave the system without the cache file
> cons:
> - add a setting to base/make.conf for a long period of time to ensure
> most of our user have migrated (how long would it be btw, 6 months, 1
> year ?)
> - does not protect other packages from owning the package due to this
> very solution for the time the setting is left in base/make.conf
That's where you convince Zac to accept my patch that applies
COLLISION_IGNORE only to unowned files.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 19:44 ` Gilles Dartiguelongue
2013-09-04 19:48 ` Ian Stakenvicius
@ 2013-09-04 20:07 ` Zac Medico
1 sibling, 0 replies; 26+ messages in thread
From: Zac Medico @ 2013-09-04 20:07 UTC (permalink / raw
To: gentoo-dev
On 09/04/2013 12:44 PM, Gilles Dartiguelongue wrote:
> Le mercredi 04 septembre 2013 à 15:23 -0400, Ian Stakenvicius a écrit :
>> If you want to do that *and* maintain whatever is currently in that
>> file, you can use the trick sys-apps/openrc used to do: in
>> pkg_preinst, copy the system file (if it exists) into ${D}, and then
>> let that same copy be merged back into the system. Openrc did it to
>> get around CONFIG_PROTECT, but it had the unfortunate side effect of
>> making the package own the file. I don't know if removal will be
>> affected by this though if the contents of the file change after the
>> ebuild owning it was merged?
>
> That sounds like a good idea, I guess it does not cause a
> collision-protect error because the file is added to ${D} after
> comparison between ${D} and live file-system ?
Right. The collision check happens _before_ pkg_preinst, so it's
possible to create a file in ${D} during pkg_preinst in order to fool
collision-protect.
--
Thanks,
Zac
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 19:48 ` Ian Stakenvicius
2013-09-04 19:49 ` Ian Stakenvicius
@ 2013-09-04 20:19 ` Gilles Dartiguelongue
2013-09-04 20:21 ` Ian Stakenvicius
` (2 more replies)
1 sibling, 3 replies; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-09-04 20:19 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1281 bytes --]
Le mercredi 04 septembre 2013 à 15:48 -0400, Ian Stakenvicius a écrit :
> On 04/09/13 03:44 PM, Gilles Dartiguelongue wrote:
> > Le mercredi 04 septembre 2013 à 15:23 -0400, Ian Stakenvicius a
> > écrit : [snip]
> >>
> >> By gdk-pixbuf.cache , you mean the 'loaders.cache' file that the
> >> eclass is now continuously updating? Which ebuild is going to
> >> 'own' it?
> >
> > yes, gdk-pixbuf is going to own it since it is the main loader
> > provider and the package that provides the tool to generate the
> > cache.
> >
> >> Also, is it owned by anything right now? IIRC we don't try
> >> particularly hard to support FEATURES="collision-protect" in the
> >> tree, but rather FEATURES="protect-owned", and so if the file is
> >> currently sitting there unowned by any package, afaik you
> >> shouldn't get any collisions by installing over it.
> >
> > it is not owned by any package right now but touching the file in
> > src_install made collision-protect abort the install.
>
> You had FEATURES="collision-protect" enabled" or the default
> FEATURES="protect-owned" ?
the default, but since I only touched the file, maybe it's
FEATURES="config-protect-if-modified" kicking in ?
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 20:19 ` Gilles Dartiguelongue
@ 2013-09-04 20:21 ` Ian Stakenvicius
2013-09-04 20:51 ` Michał Górny
2013-09-10 0:29 ` Gilles Dartiguelongue
2 siblings, 0 replies; 26+ messages in thread
From: Ian Stakenvicius @ 2013-09-04 20:21 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 04/09/13 04:19 PM, Gilles Dartiguelongue wrote:
> Le mercredi 04 septembre 2013 à 15:48 -0400, Ian Stakenvicius a
> écrit :
>>
>> You had FEATURES="collision-protect" enabled" or the default
>> FEATURES="protect-owned" ?
>
> the default, but since I only touched the file, maybe it's
> FEATURES="config-protect-if-modified" kicking in ?
>
Is the file stored in a CONFIG_PROTECT area? If that's the case you
have much bigger headaches to deal with, i expect.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
iF4EAREIAAYFAlInlkgACgkQ2ugaI38ACPBlzAD/dzO8Nnd3XHVWnUh2kIE4ynF2
adAUNJcMBdghsHoM4MgA/RFRig4N9fExncCI782eUPdMfVNwKM0oVxo7zIuDgGmy
=UaH3
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 20:19 ` Gilles Dartiguelongue
2013-09-04 20:21 ` Ian Stakenvicius
@ 2013-09-04 20:51 ` Michał Górny
2013-09-10 0:29 ` Gilles Dartiguelongue
2 siblings, 0 replies; 26+ messages in thread
From: Michał Górny @ 2013-09-04 20:51 UTC (permalink / raw
To: gentoo-dev; +Cc: eva
[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]
Dnia 2013-09-04, o godz. 22:19:30
Gilles Dartiguelongue <eva@gentoo.org> napisał(a):
> Le mercredi 04 septembre 2013 à 15:48 -0400, Ian Stakenvicius a écrit :
> > On 04/09/13 03:44 PM, Gilles Dartiguelongue wrote:
> > > Le mercredi 04 septembre 2013 à 15:23 -0400, Ian Stakenvicius a
> > > écrit : [snip]
> > >>
> > >> By gdk-pixbuf.cache , you mean the 'loaders.cache' file that the
> > >> eclass is now continuously updating? Which ebuild is going to
> > >> 'own' it?
> > >
> > > yes, gdk-pixbuf is going to own it since it is the main loader
> > > provider and the package that provides the tool to generate the
> > > cache.
> > >
> > >> Also, is it owned by anything right now? IIRC we don't try
> > >> particularly hard to support FEATURES="collision-protect" in the
> > >> tree, but rather FEATURES="protect-owned", and so if the file is
> > >> currently sitting there unowned by any package, afaik you
> > >> shouldn't get any collisions by installing over it.
> > >
> > > it is not owned by any package right now but touching the file in
> > > src_install made collision-protect abort the install.
> >
> > You had FEATURES="collision-protect" enabled" or the default
> > FEATURES="protect-owned" ?
>
> the default, but since I only touched the file, maybe it's
> FEATURES="config-protect-if-modified" kicking in ?
The default is 'protect-owned' only.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-10 0:29 ` Gilles Dartiguelongue
@ 2013-09-09 23:18 ` hasufell
2013-09-09 23:31 ` Alex Xu
1 sibling, 0 replies; 26+ messages in thread
From: hasufell @ 2013-09-09 23:18 UTC (permalink / raw
To: gentoo-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 09/10/2013 02:29 AM, Gilles Dartiguelongue wrote:
> As a follow up to this discussion, I came with the attached patch.
> It appears to work ok for regular merges and binpkg merges with
> FEATURES="collision-protect".
>
> Per my reading of PMS it does not appear to violate anything so I
> guess it is ok.
>
unreadable diff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJSLldDAAoJEFpvPKfnPDWzAlEIAKieKaMfao/xpimPOWShEZZW
AedAHki/r5b4IsZBYeE3m971SBWXMYvL4W7KAGPiLHeUzKXzN6wYLLx5Bru/uWnP
Gh7WYYnCq93Z9VnPXeeUd6Cau7cNSdcMEfjE4BRA06aNu2KSdXV3rC5PTTVM5KX0
VJ9BgjzvCs9YDzv2pmsBthoVAZv4zqrpDXLJJD6yzCyFQN/rHntnzij3aYUEAGVu
99axU7nWUrbBFOQ4C+J0ANSS1gkd+rmFudWnQ9pBpzPpPD4aQUwLTFc6+bf3Beho
jeD8TVAkUqr5OcuF278E0Rg0nqN/rvi8wglbO6855NTYi1SdNRJncujzOmc2gNI=
=DDxq
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-10 0:29 ` Gilles Dartiguelongue
2013-09-09 23:18 ` hasufell
@ 2013-09-09 23:31 ` Alex Xu
2013-09-10 10:22 ` Ian Stakenvicius
1 sibling, 1 reply; 26+ messages in thread
From: Alex Xu @ 2013-09-09 23:31 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]
On 09/09/13 08:29 PM, Gilles Dartiguelongue wrote:
>
> ^[[1;32mIndex: gdk-pixbuf-2.28.2.ebuild^[[0;0m
> ^[[1;32m===================================================================^[[0;0m
> ^[[1;32mRCS file: /var/cvsroot/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.28.2.ebuild,v^[[0;0m
> ^[[1;32mretrieving revision 1.3^[[0;0m
> ^[[1;32mdiff -u -B -r1.3 gdk-pixbuf-2.28.2.ebuild^[[0;0m
> ^[[1;31m--- gdk-pixbuf-2.28.2.ebuild 3 Sep 2013 21:59:11 -0000 1.3^[[0;0m
> ^[[1;34m+++ gdk-pixbuf-2.28.2.ebuild 9 Sep 2013 22:28:20 -0000^[[0;0m
> ^[[1;35m@@ -67,6 +67,15 @@^[[0;0m
> ^[[0;0m ^[[0;0m
> ^[[0;0m pkg_preinst() {^[[0;0m
> ^[[0;0m gnome2_gdk_pixbuf_savelist^[[0;0m
> ^[[1;34m+^[[0;0m
> ^[[1;34m+ # Make sure loaders.cache belongs to gdk-pixbuf alone^[[0;0m
> ^[[1;34m+ local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"^[[0;0m
> ^[[1;34m+^[[0;0m
> ^[[1;34m+ if [[ -e ${ROOT}${cache} ]]; then^[[0;0m
> ^[[1;34m+ cp "${ROOT}"${cache} "${D}"/${cache} || die^[[0;0m
> ^[[1;34m+ else^[[0;0m
> ^[[1;34m+ touch "${D}"/${cache} || die^[[0;0m
> ^[[1;34m+ fi^[[0;0m
> ^[[0;0m }^[[0;0m
> ^[[0;0m ^[[0;0m
> ^[[0;0m pkg_postinst() {^[[0;0m
Index: gdk-pixbuf-2.28.2.ebuild
===================================================================
RCS file:
/var/cvsroot/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.28.2.ebuild,v
retrieving revision 1.3
diff -u -B -r1.3 gdk-pixbuf-2.28.2.ebuild
--- gdk-pixbuf-2.28.2.ebuild 3 Sep 2013 21:59:11 -0000 1.3
+++ gdk-pixbuf-2.28.2.ebuild 9 Sep 2013 22:28:20 -0000
@@ -67,6 +67,15 @@
pkg_preinst() {
gnome2_gdk_pixbuf_savelist
+
+ # Make sure loaders.cache belongs to gdk-pixbuf alone
+ local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"
+
+ if [[ -e ${ROOT}${cache} ]]; then
+ cp "${ROOT}"${cache} "${D}"/${cache} || die
+ else
+ touch "${D}"/${cache} || die
+ fi
}
pkg_postinst() {
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-04 20:19 ` Gilles Dartiguelongue
2013-09-04 20:21 ` Ian Stakenvicius
2013-09-04 20:51 ` Michał Górny
@ 2013-09-10 0:29 ` Gilles Dartiguelongue
2013-09-09 23:18 ` hasufell
2013-09-09 23:31 ` Alex Xu
2 siblings, 2 replies; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-09-10 0:29 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 295 bytes --]
As a follow up to this discussion, I came with the attached patch. It
appears to work ok for regular merges and binpkg merges with
FEATURES="collision-protect".
Per my reading of PMS it does not appear to violate anything so I guess
it is ok.
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
[-- Attachment #2: gdk-pixbuf-2.28.2.ebuild.diff --]
[-- Type: text/x-patch, Size: 996 bytes --]
^[[1;32mIndex: gdk-pixbuf-2.28.2.ebuild^[[0;0m
^[[1;32m===================================================================^[[0;0m
^[[1;32mRCS file: /var/cvsroot/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.28.2.ebuild,v^[[0;0m
^[[1;32mretrieving revision 1.3^[[0;0m
^[[1;32mdiff -u -B -r1.3 gdk-pixbuf-2.28.2.ebuild^[[0;0m
^[[1;31m--- gdk-pixbuf-2.28.2.ebuild 3 Sep 2013 21:59:11 -0000 1.3^[[0;0m
^[[1;34m+++ gdk-pixbuf-2.28.2.ebuild 9 Sep 2013 22:28:20 -0000^[[0;0m
^[[1;35m@@ -67,6 +67,15 @@^[[0;0m
^[[0;0m ^[[0;0m
^[[0;0m pkg_preinst() {^[[0;0m
^[[0;0m gnome2_gdk_pixbuf_savelist^[[0;0m
^[[1;34m+^[[0;0m
^[[1;34m+ # Make sure loaders.cache belongs to gdk-pixbuf alone^[[0;0m
^[[1;34m+ local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"^[[0;0m
^[[1;34m+^[[0;0m
^[[1;34m+ if [[ -e ${ROOT}${cache} ]]; then^[[0;0m
^[[1;34m+ cp "${ROOT}"${cache} "${D}"/${cache} || die^[[0;0m
^[[1;34m+ else^[[0;0m
^[[1;34m+ touch "${D}"/${cache} || die^[[0;0m
^[[1;34m+ fi^[[0;0m
^[[0;0m }^[[0;0m
^[[0;0m ^[[0;0m
^[[0;0m pkg_postinst() {^[[0;0m
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-09 23:31 ` Alex Xu
@ 2013-09-10 10:22 ` Ian Stakenvicius
2013-09-10 15:10 ` Fabian Groffen
0 siblings, 1 reply; 26+ messages in thread
From: Ian Stakenvicius @ 2013-09-10 10:22 UTC (permalink / raw
To: gentoo-dev@lists.gentoo.org
On 2013-09-09, at 7:31 PM, Alex Xu <alex_y_xu@yahoo.ca> wrote:
> On 09/09/13 08:29 PM, Gilles Dartiguelongue wrote:
>>
>> ^[[1;32mIndex: gdk-pixbuf-2.28.2.ebuild^[[0;0m
>> ^[[1;32m===================================================================^[[0;0m
>> ^[[1;32mRCS file: /var/cvsroot/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.28.2.ebuild,v^[[0;0m
>> ^[[1;32mretrieving revision 1.3^[[0;0m
>> ^[[1;32mdiff -u -B -r1.3 gdk-pixbuf-2.28.2.ebuild^[[0;0m
>> ^[[1;31m--- gdk-pixbuf-2.28.2.ebuild 3 Sep 2013 21:59:11 -0000 1.3^[[0;0m
>> ^[[1;34m+++ gdk-pixbuf-2.28.2.ebuild 9 Sep 2013 22:28:20 -0000^[[0;0m
>> ^[[1;35m@@ -67,6 +67,15 @@^[[0;0m
>> ^[[0;0m ^[[0;0m
>> ^[[0;0m pkg_preinst() {^[[0;0m
>> ^[[0;0m gnome2_gdk_pixbuf_savelist^[[0;0m
>> ^[[1;34m+^[[0;0m
>> ^[[1;34m+ # Make sure loaders.cache belongs to gdk-pixbuf alone^[[0;0m
>> ^[[1;34m+ local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"^[[0;0m
>> ^[[1;34m+^[[0;0m
>> ^[[1;34m+ if [[ -e ${ROOT}${cache} ]]; then^[[0;0m
>> ^[[1;34m+ cp "${ROOT}"${cache} "${D}"/${cache} || die^[[0;0m
>> ^[[1;34m+ else^[[0;0m
>> ^[[1;34m+ touch "${D}"/${cache} || die^[[0;0m
>> ^[[1;34m+ fi^[[0;0m
>> ^[[0;0m }^[[0;0m
>> ^[[0;0m ^[[0;0m
>> ^[[0;0m pkg_postinst() {^[[0;0m
>
> Index: gdk-pixbuf-2.28.2.ebuild
> ===================================================================
> RCS file:
> /var/cvsroot/gentoo-x86/x11-libs/gdk-pixbuf/gdk-pixbuf-2.28.2.ebuild,v
> retrieving revision 1.3
> diff -u -B -r1.3 gdk-pixbuf-2.28.2.ebuild
> --- gdk-pixbuf-2.28.2.ebuild 3 Sep 2013 21:59:11 -0000 1.3
> +++ gdk-pixbuf-2.28.2.ebuild 9 Sep 2013 22:28:20 -0000
> @@ -67,6 +67,15 @@
>
> pkg_preinst() {
> gnome2_gdk_pixbuf_savelist
> +
> + # Make sure loaders.cache belongs to gdk-pixbuf alone
> + local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"
> +
> + if [[ -e ${ROOT}${cache} ]]; then
> + cp "${ROOT}"${cache} "${D}"/${cache} || die
> + else
> + touch "${D}"/${cache} || die
> + fi
> }
>
> pkg_postinst() {
>
shouldn't that be EROOT ?
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-10 10:22 ` Ian Stakenvicius
@ 2013-09-10 15:10 ` Fabian Groffen
2013-09-11 8:51 ` Gilles Dartiguelongue
0 siblings, 1 reply; 26+ messages in thread
From: Fabian Groffen @ 2013-09-10 15:10 UTC (permalink / raw
To: gentoo-dev
On 10-09-2013 06:22:38 -0400, Ian Stakenvicius wrote:
> > pkg_preinst() {
> > gnome2_gdk_pixbuf_savelist
> > +
> > + # Make sure loaders.cache belongs to gdk-pixbuf alone
> > + local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"
> > +
> > + if [[ -e ${ROOT}${cache} ]]; then
> > + cp "${ROOT}"${cache} "${D}"/${cache} || die
> > + else
> > + touch "${D}"/${cache} || die
> > + fi
> > }
> >
> > pkg_postinst() {
> >
>
>
> shouldn't that be EROOT ?
and ED in that case too
--
Fabian Groffen
Gentoo on a different level
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-11 8:51 ` Gilles Dartiguelongue
@ 2013-09-11 8:23 ` Fabian Groffen
0 siblings, 0 replies; 26+ messages in thread
From: Fabian Groffen @ 2013-09-11 8:23 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 350 bytes --]
On 11-09-2013 10:51:22 +0200, Gilles Dartiguelongue wrote:
> > > shouldn't that be EROOT ?
> >
> > and ED in that case too
>
> Do we still use that in EAPI > 3 ?
EROOT = ROOT + EPREFIX
ED = D + EPREFIX
Unless I misunderstand your question, that means "yes, we do" to me.
Fabian
--
Fabian Groffen
Gentoo on a different level
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 194 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update
2013-09-10 15:10 ` Fabian Groffen
@ 2013-09-11 8:51 ` Gilles Dartiguelongue
2013-09-11 8:23 ` Fabian Groffen
0 siblings, 1 reply; 26+ messages in thread
From: Gilles Dartiguelongue @ 2013-09-11 8:51 UTC (permalink / raw
To: gentoo-dev
Le mardi 10 septembre 2013 à 17:10 +0200, Fabian Groffen a écrit :
> On 10-09-2013 06:22:38 -0400, Ian Stakenvicius wrote:
> > > pkg_preinst() {
> > > gnome2_gdk_pixbuf_savelist
> > > +
> > > + # Make sure loaders.cache belongs to gdk-pixbuf alone
> > > + local cache="usr/$(get_libdir)/${PN}-2.0/2.10.0/loaders.cache"
> > > +
> > > + if [[ -e ${ROOT}${cache} ]]; then
> > > + cp "${ROOT}"${cache} "${D}"/${cache} || die
> > > + else
> > > + touch "${D}"/${cache} || die
> > > + fi
> > > }
> > >
> > > pkg_postinst() {
> > >
> >
> >
> > shouldn't that be EROOT ?
>
> and ED in that case too
Do we still use that in EAPI > 3 ?
--
Gilles Dartiguelongue <eva@gentoo.org>
Gentoo
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2013-09-11 8:23 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-31 11:07 [gentoo-dev] [PATCH] gnome2-utils.eclass add support for gdk-pixbuf cache update Gilles Dartiguelongue
2013-08-31 11:40 ` Michał Górny
2013-08-31 13:00 ` Gilles Dartiguelongue
2013-08-31 13:30 ` Alex Xu
2013-08-31 14:49 ` Michał Górny
2013-08-31 16:44 ` Gilles Dartiguelongue
2013-09-01 11:29 ` Gilles Dartiguelongue
2013-09-01 12:11 ` Michał Górny
2013-09-01 15:10 ` Gilles Dartiguelongue
2013-09-04 18:57 ` Gilles Dartiguelongue
2013-09-04 19:23 ` Ian Stakenvicius
2013-09-04 19:44 ` Gilles Dartiguelongue
2013-09-04 19:48 ` Ian Stakenvicius
2013-09-04 19:49 ` Ian Stakenvicius
2013-09-04 20:19 ` Gilles Dartiguelongue
2013-09-04 20:21 ` Ian Stakenvicius
2013-09-04 20:51 ` Michał Górny
2013-09-10 0:29 ` Gilles Dartiguelongue
2013-09-09 23:18 ` hasufell
2013-09-09 23:31 ` Alex Xu
2013-09-10 10:22 ` Ian Stakenvicius
2013-09-10 15:10 ` Fabian Groffen
2013-09-11 8:51 ` Gilles Dartiguelongue
2013-09-11 8:23 ` Fabian Groffen
2013-09-04 20:07 ` Zac Medico
2013-09-04 19:56 ` Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox