Skip to content

Commit

Permalink
doebuild.py: PVR includes -r0 if explicitly specified
Browse files Browse the repository at this point in the history
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: #1028
Signed-off-by: Ulrich Müller <[email protected]>
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
ulm authored and thesamesam committed Apr 29, 2023
1 parent 4cc3e2d commit e788ace
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Bug fixes:
* All _E_*DESTTREE_ variables to renamed to __E_*DESTTREE, in order to move
them to the __* namespace which is reserved for the package manager.

* The PVR variable includes -r0 if explicitly specified (bug #875362).

portage-3.0.46 (2023-04-07)
---------------

Expand Down
8 changes: 2 additions & 6 deletions lib/portage/package/ebuild/doebuild.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2010-2021 Gentoo Authors
# Copyright 2010-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

__all__ = ["doebuild", "doebuild_environment", "spawn", "spawnebuild"]
Expand Down Expand Up @@ -443,15 +443,11 @@ def doebuild_environment(
mysettings["PN"] = mysplit[0]
mysettings["PV"] = mysplit[1]
mysettings["PR"] = mysplit[2]
mysettings["PVR"] = mypv[len(mysplit[0]) + 1 :]

if noiselimit < 0:
mysettings["PORTAGE_QUIET"] = "1"

if mysplit[2] == "r0":
mysettings["PVR"] = mysplit[1]
else:
mysettings["PVR"] = mysplit[1] + "-" + mysplit[2]

# All temporary directories should be subdirectories of
# $PORTAGE_TMPDIR/portage, since it's common for /tmp and /var/tmp
# to be mounted with the "noexec" option (see bug #346899).
Expand Down
2 changes: 1 addition & 1 deletion man/ebuild.5
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Contains the revision number or 'r0' if no revision number exists.
.fi
.TP
.B PVR
Contains the version number with the revision (if non-zero).
Contains the version number with the revision (if any).

\fBExample\fR:
.nf
Expand Down

0 comments on commit e788ace

Please sign in to comment.