Bug 15821 - Empty directory is removed when directory is a symlink
Summary: Empty directory is removed when directory is a symlink
Status: ACCEPTED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.6.3
Hardware: x86 Multiple
: Medium normal
Target Milestone: next-patch
Assignee: Alex Stewart
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-04-03 13:55 UTC by Mikael Pahmp
Modified: 2025-04-14 13:36 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pahmp 2025-04-03 13:55:28 UTC
When an ipk package installs things into a directory and that directoy is actually a symlink to another directory, when the package is removed and was the only package to put things in that directory, opkg removes the symlink even though it points to a non-empty directory.

This happens for instance when installing into /lib which is often a symlink to /usr/lib.

This is not a problem when upgrading the only package having files in a directory, as long as the new version also have things in that directory, but if the new version doesn't, the symlink is removed. This is an issue when adapting a package to not install into /lib but instead install into /usr/lib.
Comment 1 Alex Stewart 2025-04-07 18:16:50 UTC
Thanks for the bug, Mikael.

Do you know how dpkg handles cases like this?

And also, I assume this bug is in an opkg release from after we added the autoremove functionality. But what version are you using specifically?
Comment 2 Mikael Pahmp 2025-04-10 10:04:56 UTC
Correction. This was not version 1.0 of opkg. It was 0.6.3 (not available to select among versions above) selected by yocto 5.0.7.

I do not know how dpkg handles this.