Your message dated Wed, 22 Apr 2026 10:06:09 +0000
with message-id <[email protected]>
and subject line Re: Bug#631857: developers-reference: please document best
practices for relocating binaries
has caused the Debian Bug report #631857,
regarding debian-policy: unclear about how packages should move dirs while
allowing compat symlinks
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
631857: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=631857
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: debian-policy
Version: 3.6.1.0
Severity: normal
Background:
Occasionally directories are moved from one tree to another, and
maintainers want to keep compat symlinks for various reasons.
However, section 6.5. of current policy (Details of unpack phase of
installation or upgrade) reads:
A directory will never be replaced by a symbolic link to a
directory or vice versa; instead, the existing state (symlink or
not) will be left alone and `dpkg' will follow the symlink if
there is one.
That appears to mean that package maintainers should handle this in some
way, as explained back in 2001 in http://bugs.debian.org/17624. At that
time it seems there was information about this in the now-dead packaging
manual.
I could find no current guidelines about how this common operation ought to
be done. Several docbook packages show the following in their postinst:
# do symlinks manually, til I figure out the problem
if [ "$1" = configure ]; then
rm -rf /usr/share/sgml/docbook/custom/html-forms
cd /usr/share/sgml/docbook/custom
ln -s ../../../xml/docbook/custom/html-forms html-forms
fi
Doing so somewhat defeats the purpose of implementing the policy item copied
above, but indeed I cannot see how this could be safely and consistently
handled.
In such simple cases as docbook-xml addons, it is highly probable that the
postinst snippet above is sufficient, but there are cases where it will be
problematic.
Even in this case, there is at least one other possiblity I can think of,
which would be to use "rmdir" instead of "rm -rf", since when the rm is
valid, it means that the package is the only owner of this dir, and at that
time there should be no more files in it. If there are any other files,
then the package probably lacks a conflict with the package owning those
files, and removing them would be an error.
I suggest that the policy says something like:
If a package has to replace a directory with a symbolic link, then,
in addition to shipping that new version of the file in the package,
it must remove (using rmdir) that old directory in its postinst, and
declare a (usually versionned) conflict with all other packages
owning files under this directory.
--
Yann Dirson <[email protected]> |
Debian-related: <[email protected]> | Support Debian GNU/Linux:
| Freedom, Power, Stability, Gratis
http://ydirson.free.fr/ | Check <http://www.debian.org/>
--- End Message ---
--- Begin Message ---
On Tue, Apr 21, 2026 at 11:56:06PM +0200, Serafeim (Serafi) Zanikolas wrote:
> with usrmerge and https://subdivi.de/~helmut/dep17.html in place, how often is
> it the case that a binary needs to be relocated? I'm skeptical that this
> warrants coverage in devref.
agreed, thus closing, thanks.
(we also have too many open bugs against devref, so this is helpful getting to
the ones really worth fixing! :)
--
cheers,
Holger
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ holger@(debian|reproducible-builds|layer-acht).org
⢿⡄⠘⠷⠚⠋⠀ OpenPGP: B8BF54137B09D35CF026FE9D 091AB856069AAA1C
⠈⠳⣄
Where will you go when you become a climate refugee?
signature.asc
Description: PGP signature
--- End Message ---