Bug#271751: patch

Joey Hess Joey Hess <joeyh@debian.org>, 271751@bugs.debian.org
Tue, 28 Sep 2004 20:39:18 -0400


--vGgW1X5XWziG23Ko
Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP"
Content-Disposition: inline


--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Here's a patch around this problem. It's not very pretty, but it works
fine -- it makes scrollkeeper-update not do anything when the
scrollkeeper package is not configured, using a
/usr/share/scrollkeeper/configured file.

I've taken the liberty of uploading this patch to the delayed upload
queue, with a 7 day delay. Feel free to superscede it with a better fix
in the meantime, but I do think we must fix this for the sarge release.

--=20
see shy jo

--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="scrollkeeper.patch"
Content-Transfer-Encoding: quoted-printable

diff --new-file -ur old/scrollkeeper-0.3.14/cl/src/update.c scrollkeeper-t/=
cl/src/update.c
--- old/scrollkeeper-0.3.14/cl/src/update.c	2003-09-02 07:08:47.000000000 -=
0400
+++ scrollkeeper-t/cl/src/update.c	2004-09-28 10:49:20.000000000 -0400
@@ -412,6 +412,17 @@
     	pclose(config_fid);
     }
    =20
+    /* Hack for Debian: If scrollkeeper is not configured, do nothing.
+     * so that packages that call scrollkeeper-update in their postinsts
+     * will not generate lots of ugly messages if the scrollkeeper DTDs are
+     * not yet configured. */
+    if (strcmp(scrollkeeper_dir, "/var/lib/scrollkeeper") =3D=3D 0 &&
+	(stat("/usr/share/scrollkeeper/configured", &buf) !=3D 0 ||
+        ! S_ISREG(buf.st_mode))) {
+	fprintf(stderr, "scrollkeeper-update: deferring update until scrollkeeper=
 is configured\n");
+        exit(0);
+    }
+   =20
     fid =3D popen("scrollkeeper-config --pkgdatadir", "r");
     fscanf(fid, "%s", scrollkeeper_data_dir);
     pclose(fid);
diff --new-file -ur old/scrollkeeper-0.3.14/debian/changelog scrollkeeper-t=
/debian/changelog
--- old/scrollkeeper-0.3.14/debian/changelog	2004-09-28 10:17:07.000000000 =
-0400
+++ scrollkeeper-t/debian/changelog	2004-09-28 10:49:54.000000000 -0400
@@ -1,3 +1,14 @@
+scrollkeeper (0.3.14-9.1) unstable; urgency=3Dlow
+
+  * NMU
+  * Make postinst touch /usr/share/scrollkeeper/configured, and add a prer=
m to
+    delete it. Hack scrollkeeper-update to check for this file and abort if
+    it's not available, to avoid ugly messages when packages using
+    scrollkeeper try to run scrollkeeper-update when scrollkeeper is not
+    configured and DTDs are not yet registered. Closes: #271751
+
+ -- Joey Hess <joeyh@debian.org>  Tue, 28 Sep 2004 09:50:21 -0400
+
 scrollkeeper (0.3.14-9) unstable; urgency=3Dlow
=20
   * [debian/patches/01_configure.diff] Removed.
diff --new-file -ur old/scrollkeeper-0.3.14/debian/scrollkeeper.postinst sc=
rollkeeper-t/debian/scrollkeeper.postinst
--- old/scrollkeeper-0.3.14/debian/scrollkeeper.postinst	2004-09-28 10:17:0=
8.000000000 -0400
+++ scrollkeeper-t/debian/scrollkeeper.postinst	2004-09-28 10:50:04.0000000=
00 -0400
@@ -2,6 +2,8 @@
=20
 #DEBHELPER#
=20
+touch /usr/share/scrollkeeper/configured
+
 if [ "$1" =3D "configure" ]; then
  printf "Rebuilding the database. This may take some time.\n"
  scrollkeeper-rebuilddb -q
diff --new-file -ur old/scrollkeeper-0.3.14/debian/scrollkeeper.prerm scrol=
lkeeper-t/debian/scrollkeeper.prerm
--- old/scrollkeeper-0.3.14/debian/scrollkeeper.prerm	1969-12-31 19:00:00.0=
00000000 -0500
+++ scrollkeeper-t/debian/scrollkeeper.prerm	2004-09-28 10:50:20.000000000 =
-0400
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+rm -f /usr/share/scrollkeeper/configured
+#DEBHELPER#
+

--5mCyUwZo2JvN/JJP--

--vGgW1X5XWziG23Ko
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBWgQ1d8HHehbQuO8RAtL7AKDT/7+4LEAIIvJtn3bFeU0SObavugCgtokE
fnP9CxsEOI4byEUzTKO/nOw=
=la7p
-----END PGP SIGNATURE-----

--vGgW1X5XWziG23Ko--