Subject: Re: bug#77143: 30.1; package--description-file handles some packages wrong

From: Stefan Monnier <[email-masked]>
Date: Mon, 31 Mar 2025 15:04:19 -0400

>> I also notice that the version part of the regex can be improved because
>> it does not take `version-regexp-alist' into consideration.  But that is
>> out of the scope of this bug.
>
> I tested the above patch with all elisp packages from (Non)GNU(-devel)
> ELPA and MELPA.  All 7 packages from my initial post are fixed.  At the
> same time, I find only one package vm[0] is "broken" by my patch.
>
> Without my patch, the result is right.
> (package--description-file "vm-8.3.0snapshot0.20250208.60553")
>   ⇒ "vm-pkg.el"
>
> With my patch, the result is wrong.
> (package--description-file "vm-8.3.0snapshot0.20250208.60553")
>   ⇒ "vm-8.3.0snapshot0.20250208.60553-pkg.el"
>
> A quick fix is to add snapshot to the regex version part.

Thanks I pushed your patch, amended to add `snapshot`.

Sadly, the problem will keep biting users of older Emacsen, making the
use of such package names problematic for years to come.

> A proper fix is to make the regex version part know
> `version-regexp-alist'.

Actually, we need only to match the versions generated by
`package-version-join`, not all the versions that `version-to-list`
accepts (luckily, because that would make the thing even more delicate
since `version-to-list` allows `-` to appear within a version name,
introducing a lot more ambiguity).

        Stefan