[dconf/f18] Move some of the rpm scriptlets back to %posttrans
Kalev Lember
kalev at fedoraproject.org
Fri Nov 9 21:02:12 UTC 2012
commit 63acfb9ad0b3d6e39f520dfcf3649853c8c7f3c7
Author: Kalev Lember <kalevlember at gmail.com>
Date: Fri Nov 9 21:42:04 2012 +0100
Move some of the rpm scriptlets back to %posttrans
This partially reverts commit 38d8a9c2.
glib-compile-schemas and gtk-update-icon-cache are deliberately split up
between %post and %posttrans to optimize the scriptlet run time with
multi-package transactions.
Instead of regenerating the whole icon cache after every single package
install (in %post), this splits it in two: in %post, there's just a
"touch %{_datadir}/icons/hicolor", and the icon cache is later
regenerated once after the whole transaction (in %posttrans). The very
first gtk-update-icon-cache call in %posttrans regenerates the cache,
and the subsequent ones are no-op because the icon files (and directory
timestamps) don't change during the sequential %posttrans runs.
http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Icon_Cache
dconf.spec | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/dconf.spec b/dconf.spec
index 0ed4080..a86fd19 100644
--- a/dconf.spec
+++ b/dconf.spec
@@ -3,7 +3,7 @@
Name: dconf
Version: 0.14.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: A configuration system
Group: System Environment/Base
@@ -61,19 +61,20 @@ make install DESTDIR=$RPM_BUILD_ROOT
%post
/sbin/ldconfig
gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
-glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor >&/dev/null || :
-gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || :
%postun
+/sbin/ldconfig
if [ $1 -eq 0 ] ; then
- /sbin/ldconfig
gio-querymodules-%{__isa_bits} %{_libdir}/gio/modules
glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
touch --no-create %{_datadir}/icons/hicolor >&/dev/null || :
gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || :
fi
+%posttrans
+glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
+gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || :
%files -f dconf.lang
%doc COPYING
@@ -109,6 +110,10 @@ fi
%{_mandir}/man1/dconf-editor.1.gz
%changelog
+* Fri Nov 09 2012 Kalev Lember <kalevlember at gmail.com> - 0.14.1-3
+- Move some of the rpm scriptlets back to %%posttrans
+ (glib-compile-schemas, icon cache)
+
* Thu Nov 8 2012 Marek Kasik <mkasik at redhat.com> - 0.14.1-2
- Move dconf-editor's man page to the dconf-editor sub-package
More information about the scm-commits
mailing list