[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#985297: libreoffice-common: do not use dir_to_symlink for /usr/lib/libreoffice/share/registry



Followup-For: Bug #985297
Control: tag -1 patch

Hi Rene,

I've been experimenting a lot to fix this bug.
One problem is Breaks in one package being handled first (by
deconfiguratio) and subsequent occurrences of Conflicts in another
package will be ignored for deconfigured packages (and removal will not
happen).

We can fix most of the upgrade issues by propagating the Conflicts to
the package with the Breaks, s.t. deconfiguration does not happen but
removal does happen immediately. Unfortunately this does not work if
there are too many packages the would need to be removed together since
dpkg does not get the optimal ordering for doing that. These are mostly
upgrade paths with libreoffice-impress or libreoffice-report-builder
installed.

So in the end I resorted to not using
  dpkg-maintscript-helper dir_to_symlink
as I had initially suggested but fixing it up manually in the postinst.

I've running various buster->bullseye upgrade scenarios (with and
without recommends, direct distupgrade vs upgrade && dist-upgrade)
with the patched packages as upgrade targets. I've rerun all piuparts
tests that had libreoffice-common installed and haven't seen any more
problems with the patched packages.

The attached patch does only patch debian/control.in, please regenerate
debian/control as this caused a lot of noise (I did nocheck builds).
It also contains adding some weird symbols with symbol version GLIBCXX_3.4
that looks weird, because libreoffice should not provide symbols with
such a version. This could also be an artefact of how I did build the
packages. Please decide what should happen to them.

Andreas
diff -Nru libreoffice-7.0.4/debian/changelog libreoffice-7.0.4/debian/changelog
--- libreoffice-7.0.4/debian/changelog	2021-01-03 18:54:17.000000000 +0100
+++ libreoffice-7.0.4/debian/changelog	2021-04-07 09:42:18.000000000 +0200
@@ -1,3 +1,16 @@
+libreoffice (1:7.0.4-4) UNRELEASED; urgency=medium
+
+  * libreoffice-core: Copy some Conflicts from libreoffice-common for smoother
+    upgrades from buster. Dpkg will otherwise ignore Conflicts that are
+    encountered later against a package that is already deconfigured.
+  * libreoffice-common: Do not use dir_to_symlink for
+    /usr/lib/libreoffice/share/registry, the Breaks/Conflicts cascade does not
+    work reliable here to ensure all packages previously shipping files there
+    are either removed or upgraded first, but not just deconfigured. Fix up
+    the symlink in postinst instead.  (Closes: #985297)
+
+ -- Andreas Beckmann <anbe@debian.org>  Wed, 07 Apr 2021 09:42:18 +0200
+
 libreoffice (1:7.0.4-3) unstable; urgency=medium
 
   * debian/tests/control.in: *really* add libreoffice-writer dependency
diff -Nru libreoffice-7.0.4/debian/control.in libreoffice-7.0.4/debian/control.in
--- libreoffice-7.0.4/debian/control.in	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/control.in	2021-04-07 09:42:18.000000000 +0200
@@ -236,6 +236,15 @@
         libreoffice-common (<< 1:5.4.1),
         libreoffice-avmedia-backend-gstreamer (<< ${binary:Version})
 Conflicts: libreoffice-filter-binfilter, libreoffice-avmedia-backend-vlc, libreoffice-mysql-connector (<< 1:6.2.0~), libreoffice-core-nogui
+# for bullseye, copied from libreoffice-common, see #985297
+ ,
+ libreoffice-base (<< 1:7.0.0~alpha~),
+ libreoffice-calc (<< 1:7.0.0~alpha~),
+ libreoffice-draw (<< 1:7.0.0~alpha~),
+ libreoffice-impress (<< 1:7.0.0~alpha~),
+ libreoffice-math (<< 1:7.0.0~alpha~),
+ libreoffice-report-builder (<< 1:7.0.0~alpha~),
+ libreoffice-writer (<< 1:7.0.0~alpha~),
 Replaces: libreoffice-pdfimport (<< 1:5.4~), libreoffice-common (<< 1:6.3.0~rc1~), libreoffice-avmedia-backend-gstreamer, libreoffice-core-nogui
 Description: office productivity suite -- arch-dependent files
  LibreOffice is a full-featured office productivity suite that provides
diff -Nru libreoffice-7.0.4/debian/libreoffice-common.maintscript libreoffice-7.0.4/debian/libreoffice-common.maintscript
--- libreoffice-7.0.4/debian/libreoffice-common.maintscript	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/libreoffice-common.maintscript	2021-04-07 09:42:18.000000000 +0200
@@ -2,4 +2,10 @@
 mv_conffile /etc/apparmor.d/usr.lib.libreofficeprogram.senddoc /etc/apparmor.d/usr.lib.libreoffice.program.senddoc 1:5.4.3-1
 mv_conffile /etc/apparmor.d/usr.lib.libreofficeprogram.soffice.bin /etc/apparmor.d/usr.lib.libreoffice.program.soffice.bin 1:5.4.3-1
 mv_conffile /etc/apparmor.d/usr.lib.libreofficeprogram.xpdfimport /etc/apparmor.d/usr.lib.libreoffice.program.xpdfimport 1:5.4.3-1
-dir_to_symlink /usr/lib/libreoffice/share/registry /etc/libreoffice/registry 1:7.0.2~rc1-1 
+
+# do this manually since dpkg-maintscript-helper dir_to_symlink
+# does not work reliably in this case because we cannot ensure that all
+# conflicting packages previously shipping files in
+# /usr/lib/libreoffice/share/registry are either upgraded or removed
+# but not just deconfigured, see #985297
+#dir_to_symlink /usr/lib/libreoffice/share/registry /etc/libreoffice/registry 1:7.0.2~rc1-1 
diff -Nru libreoffice-7.0.4/debian/libreoffice-common.postinst.in libreoffice-7.0.4/debian/libreoffice-common.postinst.in
--- libreoffice-7.0.4/debian/libreoffice-common.postinst.in	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/libreoffice-common.postinst.in	2021-04-07 09:42:18.000000000 +0200
@@ -27,3 +27,17 @@
 
 #DEBHELPER#
 
+# do this manually since dpkg-maintscript-helper dir_to_symlink
+# does not work reliably in this case because we cannot ensure that all
+# conflicting packages previously shipping files in
+# /usr/lib/libreoffice/share/registry are either upgraded or removed
+# but not just deconfigured, see #985297
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt-nl "1:7.0.4-4~" ; then
+	if [ ! -L /usr/lib/libreoffice/share/registry ]; then
+		if [ -d /usr/lib/libreoffice/share/registry ]; then
+			# this will fail if the directory is not yet empty
+			rmdir -v /usr/lib/libreoffice/share/registry
+		fi
+		ln -sfvT /etc/libreoffice/registry /usr/lib/libreoffice/share/registry
+	fi
+fi
diff -Nru libreoffice-7.0.4/debian/libuno-cppu3.symbols libreoffice-7.0.4/debian/libuno-cppu3.symbols
--- libreoffice-7.0.4/debian/libuno-cppu3.symbols	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/libuno-cppu3.symbols	2021-04-07 09:42:18.000000000 +0200
@@ -7,3 +7,4 @@
 # add new stuff BELOW this line
 # and note that the stuff above HAS NO epoch but the
 # below HAS
+ (symver)GLIBCXX_3.4 1:7.0.4-4~
diff -Nru libreoffice-7.0.4/debian/libuno-cppuhelpergcc3-3.symbols libreoffice-7.0.4/debian/libuno-cppuhelpergcc3-3.symbols
--- libreoffice-7.0.4/debian/libuno-cppuhelpergcc3-3.symbols	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/libuno-cppuhelpergcc3-3.symbols	2021-04-07 09:42:18.000000000 +0200
@@ -13,3 +13,4 @@
 # add new stuff BELOW this line
 # and note that the stuff above HAS NO epoch but the
 # below HAS
+ (symver)GLIBCXX_3.4 1:7.0.4-4~
diff -Nru libreoffice-7.0.4/debian/libuno-purpenvhelpergcc3-3.symbols libreoffice-7.0.4/debian/libuno-purpenvhelpergcc3-3.symbols
--- libreoffice-7.0.4/debian/libuno-purpenvhelpergcc3-3.symbols	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/libuno-purpenvhelpergcc3-3.symbols	2021-04-07 09:42:18.000000000 +0200
@@ -1,4 +1,5 @@
 libuno_purpenvhelpergcc3.so.3 libuno-purpenvhelpergcc3-3 #MINVER#
+ (symver)GLIBCXX_3.4 1:7.0.4-4~
  (symver)UDK_3_0_0 1.4.0
 # add new stuff BELOW this line
 # and note that the stuff above HAS NO epoch but the
diff -Nru libreoffice-7.0.4/debian/libuno-sal3.symbols libreoffice-7.0.4/debian/libuno-sal3.symbols
--- libreoffice-7.0.4/debian/libuno-sal3.symbols	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/libuno-sal3.symbols	2021-04-07 09:42:18.000000000 +0200
@@ -36,3 +36,4 @@
 # add new stuff BELOW this line
 # and note that the stuff above HAS NO epoch but the
 # below HAS
+ (symver)GLIBCXX_3.4 1:7.0.4-4~
diff -Nru libreoffice-7.0.4/debian/libuno-salhelpergcc3-3.symbols libreoffice-7.0.4/debian/libuno-salhelpergcc3-3.symbols
--- libreoffice-7.0.4/debian/libuno-salhelpergcc3-3.symbols	2020-12-31 11:27:09.000000000 +0100
+++ libreoffice-7.0.4/debian/libuno-salhelpergcc3-3.symbols	2021-04-07 09:42:18.000000000 +0200
@@ -5,3 +5,4 @@
 # add new stuff BELOW this line
 # and note that the stuff above HAS NO epoch but the
 # below HAS
+ (symver)GLIBCXX_3.4 1:7.0.4-4~

Reply to: