If I create foo-1-r0.ebuild: PF="foo-1-r0" (correct) but: PVR="1" (i.e. it's missing -r0) PMS doesn't specify any normalization, so these should copy the ebuild verbatim.
You should rename your ebuild to foo-1-r00.ebuils, then you'll get a correct PVR="1-r00". :) Obviously this behaviour makes no sense. The relevant code in doebuild.py looks trivial, so why hasn't this been fixed yet? if mysplit[2] == "r0": mysettings["PVR"] = mysplit[1] else: mysettings["PVR"] = mysplit[1] + "-" + mysplit[2]
(In reply to Ulrich Müller from comment #1) > Obviously this behaviour makes no sense. The relevant code in doebuild.py > looks trivial, so why hasn't this been fixed yet? > I don't think comments like the last part are helpful.
A simple fix would be to check for explicit -r0: - if mysplit[2] == "r0": + if mysplit[2] == "r0" and not mypv.endswith("-r0"): Alternatively one could rewrite _pkgsplit, but presumably such a fix would be quite intrusive.
BTW, the logic that checks for the explicit string "0" was added in 2001: https://gitweb.gentoo.org/archive/repo/gentoo-2.git/commit/?id=9aa2cf18b4de3c81fd5bc98718b2614bd2e73d23
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=e788ace298fbbe5d656b64ce75b9376b0ecb407a commit e788ace298fbbe5d656b64ce75b9376b0ecb407a Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2023-04-28 15:04:30 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-29 04:41:37 +0000 doebuild.py: PVR includes -r0 if explicitly specified PMS says that PVR is "Package version and revision (if any)". https://projects.gentoo.org/pms/8/pms.html#x1-109001r1 Pkgcore and Paludis follow PMS, i.e. PVR includes an explicit -r0 (in other words, ${PF} is always equal to ${PN}-${PVR} for them). The previous logic for PVR had been added in 2001: https://gitweb.gentoo.org/archive/repo/gentoo-2.git/commit/?id=9aa2cf18b4de3c81fd5bc98718b2614bd2e73d23 Bug: https://bugs.gentoo.org/875362 Closes: https://github.com/gentoo/portage/pull/1028 Signed-off-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org> NEWS | 2 ++ lib/portage/package/ebuild/doebuild.py | 8 ++------ man/ebuild.5 | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b3c80502e96406b4b175e2ee79eb65f3f3cd9f6 commit 5b3c80502e96406b4b175e2ee79eb65f3f3cd9f6 Author: Sam James <sam@gentoo.org> AuthorDate: 2023-04-30 04:13:31 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-30 04:13:36 +0000 sys-apps/portage: add 3.0.47 Bug: https://bugs.gentoo.org/597800 Closes: https://bugs.gentoo.org/903973 Closes: https://bugs.gentoo.org/875362 Closes: https://bugs.gentoo.org/904895 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.47.ebuild | 285 +++++++++++++++++++++++++++++++++ 2 files changed, 286 insertions(+)