Source: readline
Version: 8.2-1.3
Severity: normal
Tags: patch
User: helm...@debian.org
Usertags: dep17m2
X-Debbugs-Cc: vor...@debian.org

We want to finalize the /usr-merge transition via DEP17 by moving all
aliased files from / to /usr. Until recently, doing so was prohibited by
the file move moratorium. It has since been delegated to
https://wiki.debian.org/UsrMerge and we may move files albeit carefully.
https://subdivi.de/~helmut/dep17.html provides a set of things that may
go wrong.

A major aspect is the interaction with the 2038 transition
https://wiki.debian.org/ReleaseGoals/64bit-time. If libreadline8 is
renamed to libreadline8t64, upgrades from bookworm to trixie will move
files from / to /usr and between packages triggering exactly the file
loss scenario that the moratorium was meant to prevent (DEP17 P1). We
probably cannot use Conflicts (DEP17 M7) due to readline being
relatively central and have to resort to protective diversions (DEP17
M8) instead. When this comes about, please upload to experimental first
and wait at least three days. Fortunately, readline is unaffected by
most of the other problems. The debian-installer can deal with libraries
in /usr/lib/<triplet> (DEP17 P10) and the multiarch file loss (DEP17 P7)
is not applicable, because all affected filenames are
architecture-dependent. I locally verified that debootstrap continues to
work in the presence of this change.

Hence, I think we're good to go. I assume that readline is not subject
to backporting and have included a bit of cleanup in the attached patch.
Do not upload this patch to bookworm-backports. If you want to support
backports, use dh_movetousr instead. Also remember to upload
restructuring changes (such as libreadline8t64) during the trixie cycle
to experimental first.

Helmut
diff --minimal -Nru readline-8.2/debian/changelog readline-8.2/debian/changelog
--- readline-8.2/debian/changelog       2023-01-03 21:49:45.000000000 +0100
+++ readline-8.2/debian/changelog       2023-11-14 20:16:55.000000000 +0100
@@ -1,3 +1,10 @@
+readline (8.2-1.4) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Move libraries to /usr. (Closes: #-1)
+
+ -- Helmut Grohne <hel...@subdivi.de>  Tue, 14 Nov 2023 20:16:55 +0100
+
 readline (8.2-1.3) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru readline-8.2/debian/rules readline-8.2/debian/rules
--- readline-8.2/debian/rules   2022-11-11 07:26:09.000000000 +0100
+++ readline-8.2/debian/rules   2023-11-14 20:16:55.000000000 +0100
@@ -47,8 +47,7 @@
 ifneq (,$(findstring /$(DEB_HOST_ARCH)/,/amd64/ppc64/))
   build32 = yes
   CC32 = $(CROSS) -m32
-  lib32dir = lib32
-  lib32devdir = usr/lib32
+  lib32dir = usr/lib32
   gencontrol_flags = -- \
        '-Vdevxx:Depends=libc6-dev-$(ARCH32)'
   ifeq ($(DEB_HOST_ARCH),amd64)
@@ -250,15 +249,9 @@
 
        : # move $(p_rl)
        dh_installdirs -p$(p_rl) \
-               etc \
-               lib/$(DEB_HOST_MULTIARCH) \
+               usr/lib/$(DEB_HOST_MULTIARCH) \
                usr/share/doc
-       cp -a $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/lib{history,readline}.so.* 
$(d_rl)/lib/$(DEB_HOST_MULTIARCH)/
-#      cp -a $(d)/usr/lib/lib{history,readline}.so.$(libversion) $(d_rl)/lib/
-#      ln -s libhistory.so.$(libversion) \
-#              $(d_rl)/lib/libhistory.so.$(soversion)
-#      ln -s libreadline.so.$(libversion) \
-#              $(d_rl)/lib/libreadline.so.$(soversion)
+       cp -a $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/lib{history,readline}.so.* 
$(d_rl)/usr/lib/$(DEB_HOST_MULTIARCH)/
 
        : # move $(p_comm)
        dh_installdirs -p$(p_comm) \
@@ -279,9 +272,9 @@
                usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
                usr/share/doc \
                usr/share/info
-       ln -s /lib/$(DEB_HOST_MULTIARCH)/libhistory.so.$(soversion) \
+       ln -s libhistory.so.$(soversion) \
                $(d_rld)/usr/lib/$(DEB_HOST_MULTIARCH)/libhistory.so
-       ln -s /lib/$(DEB_HOST_MULTIARCH)/libreadline.so.$(soversion) \
+       ln -s libreadline.so.$(soversion) \
                $(d_rld)/usr/lib/$(DEB_HOST_MULTIARCH)/libreadline.so
        mv $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/lib{history,readline}.a \
                $(d_rld)/usr/lib/$(DEB_HOST_MULTIARCH)/.
@@ -327,13 +320,13 @@
            infodir=/usr/share/info
 
        dh_installdirs -p$(p_rlu) \
-           lib/$(DEB_HOST_MULTIARCH)
+           usr/lib/$(DEB_HOST_MULTIARCH)
        cp -p 
$(du)/usr/lib/$(DEB_HOST_MULTIARCH)/lib{history,readline}.so.$(libversion) \
-               $(d_rlu)/lib/$(DEB_HOST_MULTIARCH)/
+               $(d_rlu)/usr/lib/$(DEB_HOST_MULTIARCH)/
        ln -s libhistory.so.$(libversion) \
-               $(d_rlu)/lib/$(DEB_HOST_MULTIARCH)/libhistory.so.$(soversion)
+               
$(d_rlu)/usr/lib/$(DEB_HOST_MULTIARCH)/libhistory.so.$(soversion)
        ln -s libreadline.so.$(libversion) \
-               $(d_rlu)/lib/$(DEB_HOST_MULTIARCH)/libreadline.so.$(soversion)
+               
$(d_rlu)/usr/lib/$(DEB_HOST_MULTIARCH)/libreadline.so.$(soversion)
 
        dh_installdirs -p$(p_commu) \
                usr/share/readline
@@ -365,13 +358,13 @@
                $(d_rl32)/$(lib32dir)/libreadline.so.$(soversion)
 
        dh_installdirs -p$(p_rld32) \
-           $(lib32devdir) \
+           $(lib32dir) \
            usr/share/doc
-       ln -s /$(lib32dir)/libhistory.so.$(soversion) \
-               $(d_rld32)/$(lib32devdir)/libhistory.so
-       ln -s /$(lib32dir)/libreadline.so.$(soversion) \
-               $(d_rld32)/$(lib32devdir)/libreadline.so
-       mv $(d32)/usr/lib/lib{history,readline}.a $(d_rld32)/$(lib32devdir)/.
+       ln -s libhistory.so.$(soversion) \
+               $(d_rld32)/$(lib32dir)/libhistory.so
+       ln -s libreadline.so.$(soversion) \
+               $(d_rld32)/$(lib32dir)/libreadline.so
+       mv $(d32)/usr/lib/lib{history,readline}.a $(d_rld32)/$(lib32dir)/.
 endif
 
 ifneq ($(build64),)

Reply via email to