David Bremner <da...@tethera.net> writes:

> Xiyue Deng <manp...@gmail.com> writes:
>
>>>
>>> Is it sufficient to check the top level? what if there is deeper nested
>>> directories? Apologies if I missed some context.
>>>
>>
>> Before 2.1.1, the install script only creates symlinks for everything on
>> the top level (see code for release 2.1.1[1]).  Therefore I think
>> handling top level should be sufficient.
>>
>
> OK. Then 'find "${elcdir}" -maxdepth 1 -type l -delete'
> seems simpler / safer then the script, but if you and Sean
> are happier with the script (fragment), then that's fine.
>

SGTM.  I have implemented this at [1].  Full diff can be seen at [2].
Also verified in a local docker to be working.

>> I think what you said is true, though that's more like the work of the
>> remove script, which basically does this already.  Wiping everything
>> on every install/upgrade sounds like an overkill to me.  On the other
>> hand, it doesn't affect correctness, and should still be fast enough
>> as everything is basically a symlink.  I don't have a strong
>> preference.
>
> I guess it's unlikely, but conceivably some package installed into
> ../elpa in some custom way that involves deeper symlinks.

Fortunately, if we want to handle this case, we just need to drop the
"-maxdepth 1" part.  Let me know if you prefer this way.

> Probably that's not a case we need to worry about, and generally the
> fewer "rm -rf ${foo}" we have in maintainer script the better.

Agreed.

[1] 
https://salsa.debian.org/emacsen-team/dh-elpa/-/commit/44e62e4d98cf0b6acc21f941c91634d05ce76545
[2] 
https://salsa.debian.org/emacsen-team/dh-elpa/-/compare/master...bug%231104178?from_project_id=18920

-- 
Regards,
Xiyue Deng

Attachment: signature.asc
Description: PGP signature

Reply via email to