[pacman-dev] [BUG] libalpm: symlink to directory causes conflict

Ivy Foster escondida at iff.ink
Mon Sep 28 22:45:38 UTC 2020


On 28 Sep 2020, at  6:19 pm +0000, Barnabás Pőcze via pacman-dev wrote:
> Hi,

Hello,

> On my particular system '/lib' is a symbolic link to '/usr/lib'. I was creating a
> PKGBUILD for a program that places a systemd service file into '/lib/systemd/...'
> during installation. Unfortunately, when I would like to install the created
> package, libalpm detects a file conflict between '/lib' (the symlink in the
> filesystem) and '/lib' (the directory in the package).

Yes, Arch does symlink /lib -> /usr/lib, as well as /bin and /sbin ->
/usr/bin. Your PKGBUILD ought to install the service file to
/usr/lib/systemd/system, which is where it will really reside.

> this may or may not be an actual bug, I'm not sure if it's the intended behaviour. [...]
> Could someone confirm that this is indeed the intended behaviour? And if yes, why?

Pacman correctly identified /lib as a symlink and did not overwrite it
with the directory from your PKGBUILD.

This is the intended behavior: pacman will only install files to real
destinations and does not follow symlinks, so that it can always
(barring user interference) have an accurate idea of where in the
filesystem the files it installed actually are.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20200928/7722d400/attachment.sig>


More information about the pacman-dev mailing list