Per bug #301311 [1], I decided to fix a couple of issue I had with the current way of dealing with scrollkeeper.
Even though scrollkeeper is almost dead, it is still present in quite a few gnome packages notably due to gnome-doc-utils.make and the goal of these changes is to make scrollkeeper a bit more in line with gsettings, gconf and icons support. If you have some questions about the changes please read the comments on the bug report first. I searched the tree for potential problems but as far as I could see, only three ebuilds that define SCROLLKEEPER_UPDATE would need to be updated. If there is no objection, I will push the changes this weekend (it has been reviewed by a few gnome team members already). [1] https://bugs.gentoo.org/show_bug.cgi?id=301311 -- Gilles Dartiguelongue <[email protected]> Gentoo
Index: gnome2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v
retrieving revision 1.104
diff -u -B -u -r1.104 gnome2.eclass
--- gnome2.eclass 14 Dec 2011 19:47:54 -0000 1.104
+++ gnome2.eclass 14 Apr 2012 18:28:48 -0000
@@ -125,6 +125,11 @@
G2CONF="${G2CONF} --disable-maintainer-mode"
fi
+ # Pass --disable-scrollkeeper when possible
+ if grep -q "disable-scrollkeeper" configure; then
+ G2CONF="${G2CONF} --disable-scrollkeeper"
+ fi
+
# Avoid sandbox violations caused by gnome-vfs (bug #128289 and #345659)
addwrite "$(unset HOME; echo ~)/.gnome2"
@@ -172,10 +177,9 @@
# 1. The scrollkeeper database is regenerated at pkg_postinst()
# 2. ${ED}/var/lib/scrollkeeper contains only indexes for the current pkg
# thus it makes no sense if pkg_postinst ISN'T run for some reason.
- if [[ -z "$(find "${D}" -name '*.omf')" ]]; then
- export SCROLLKEEPER_UPDATE="0"
- fi
rm -rf "${ED}${sk_tmp_dir}"
+ rmdir "${ED}/var/lib" 2>/dev/null
+ rmdir "${ED}/var" 2>/dev/null
# Make sure this one doesn't get in the portage db
rm -fr "${ED}/usr/share/applications/mimeinfo.cache"
@@ -197,6 +201,7 @@
gnome2_gconf_savelist
gnome2_icon_savelist
gnome2_schemas_savelist
+ gnome2_scrollkeeper_savelist
}
# @FUNCTION: gnome2_pkg_postinst
@@ -209,10 +214,7 @@
fdo-mime_mime_database_update
gnome2_icon_cache_update
gnome2_schemas_update
-
- if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
- gnome2_scrollkeeper_update
- fi
+ gnome2_scrollkeeper_update
}
# @#FUNCTION: gnome2_pkg_prerm
@@ -230,8 +232,5 @@
fdo-mime_mime_database_update
gnome2_icon_cache_update
gnome2_schemas_update
-
- if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then
- gnome2_scrollkeeper_update
- fi
+ gnome2_scrollkeeper_update
}
Index: gnome2-utils.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v
retrieving revision 1.26
diff -u -B -u -r1.26 gnome2-utils.eclass
--- gnome2-utils.eclass 8 Apr 2012 02:29:44 -0000 1.26
+++ gnome2-utils.eclass 14 Apr 2012 18:29:12 -0000
@@ -62,6 +62,12 @@
# @DESCRIPTION:
# List of icons provided by the package
+# @ECLASS-VARIABLE: GNOME2_ECLASS_SCROLLS
+# @INTERNAL
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# List of scrolls (documentation files) provided by the package
+
# @ECLASS-VARIABLE: GNOME2_ECLASS_GLIB_SCHEMAS
# @INTERNAL
# @DEFAULT_UNSET
@@ -274,10 +279,14 @@
omf_makefiles="${omf_makefiles} ${S}/omf.make"
fi
+ if [[ -f ${S}/gnome-doc-utils.make ]] ; then
+ omf_makefiles="${omf_makefiles} ${S}/gnome-doc-utils.make"
+ fi
+
# testing fixing of all makefiles found
# The sort is important to ensure .am is listed before the respective .in for
# maintainer mode regeneration not kicking in due to .am being newer than .in
- for filename in $(find ./ -name "Makefile.in" -o -name "Makefile.am" |sort) ; do
+ for filename in $(find "${S}" -name "Makefile.in" -o -name "Makefile.am" |sort) ; do
omf_makefiles="${omf_makefiles} ${filename}"
done
@@ -287,12 +296,10 @@
local fails=( )
for omf in ${omf_makefiles} ; do
- local rv=0
-
sed -i -e 's:scrollkeeper-update:true:' "${omf}"
retval=$?
- if [[ ! $rv -eq 0 ]] ; then
+ if [[ $retval -ne 0 ]] ; then
debug-print "updating of ${omf} failed"
# Add to the list of failures
@@ -309,16 +316,39 @@
done
}
+# @FUNCTION: gnome2_scrollkeeper_savelist
+# @DESCRIPTION:
+# Find the scrolls that are about to be installed and save their location
+# in the GNOME2_ECLASS_SCROLLS environment variable.
+# This function should be called from pkg_preinst.
+gnome2_scrollkeeper_savelist() {
+ has ${EAPI:-0} 0 1 2 && ! use prefix && ED="${D}"
+ pushd "${ED}" &> /dev/null
+ export GNOME2_ECLASS_SCROLLS=$(find 'usr/share/omf' -type f -name "*.omf" 2> /dev/null)
+ popd &> /dev/null
+}
+
# @FUNCTION: gnome2_scrollkeeper_update
# @DESCRIPTION:
# Updates the global scrollkeeper database.
# This function should be called from pkg_postinst and pkg_postrm.
gnome2_scrollkeeper_update() {
has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
- if [[ -x "${EROOT}${SCROLLKEEPER_UPDATE_BIN}" ]]; then
- einfo "Updating scrollkeeper database ..."
- "${EROOT}${SCROLLKEEPER_UPDATE_BIN}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+ local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
+
+ if [[ ! -x "${updater}" ]] ; then
+ debug-print "${updater} is not executable"
+ return
+ fi
+
+ if [[ -z "${GNOME2_ECLASS_SCROLLS}" ]]; then
+ debug-print "No scroll cache to update"
+ return
fi
+
+ ebegin "Updating scrollkeeper database ..."
+ "${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+ eend $?
}
# @FUNCTION: gnome2_schemas_savelist
signature.asc
Description: This is a digitally signed message part
