[pacman-dev] [PATCH] meson: make our symlinking script more portable

Eli Schwartz eschwartz at archlinux.org
Mon Apr 19 11:18:29 UTC 2021


On 4/19/21 3:42 AM, Allan McRae wrote:
> On 18/4/21 12:42 pm, Eli Schwartz wrote:
>> We do not need the --relative case as it is dead code (we only ever link
>> a filename without directory components).
>>
>> For the rest, GNU-specific ln -T does two things:
>>
>> - if the link name is an existing directory, ln fails instead of
>>   creating a surprising link inside the directory
>> - if the link name is a symlink to a directory, ln treats it as a file,
>>   and due to -f, unlinks it
>>
>> The second case can be portably solved by ln -n, and the first case is
>> not actually currently functional, but we can portably replace the error
>> message with rmdir, so, why not?
> 
> Can we?  That assumes the directory is non-empty and rmdir fails.  I
> don't think removing an empty directory and replacing it with a symlink
> is expected behaviour.
> 
> Can we just abort with an error if the target is a directory?


I guess, but what's the difference between this and replacing a symlink
to a directory?

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20210419/698bd830/attachment.sig>


More information about the pacman-dev mailing list