On Thu, Feb 20, 2025 at 10:05:36AM +0100, Timo Röhling wrote:
> Hello,
> 
> I have run into an unexpected quirk of dpkg (I think) and would like to
> solicit some advice on how to handle it.
> 
> For better cross building/multi-arch support, I recently moved a bunch of
> files from python3-numpy to python3-numpy-dev. More precisely, I moved
> 
> /usr/lib/python3/dist-packages/numpy/_core/include
> /usr/lib/python3/dist-packages/numpy/_core/lib
> /usr/lib/python3/dist-packages/numpy/random/lib
> /usr/lib/python3/dist-packages/numpy/f2py/src
> 
> to an arch-dependent location and replaced them with symlinks. The symlinks
> are intended to retain directory layout compatibility with upstream, so
> anyone how does not care about cross building is not inconvenienced by my
> create shuffling.
> 
> This worked great for the former two directories, but the latter two are
> left as empty real directories, not symlinks, after an upgrade.
> 
> I assume it is because the _core directory is new in NumPy 2, so dpkg can
> just create the symlinks at unpack time. The latter two directories need to
> be transitioned from a real directory in NumPy 1 to a symlink during the
> package upgrade. Apparently this step fails, leaving an empty directory
> instead.
> 
> The question is, how do I fix this? I could add some code to postinst to
> check if there is an empty directory where a symlink should be. Is this a
> reasonable approach?

dpkg-maintscript-helper dir_to_symlink


-- 
WBR, wRAR

Attachment: signature.asc
Description: PGP signature

Reply via email to