mirror of
https://github.com/ceph/ceph
synced 2025-04-11 04:02:04 +00:00
script/build-with-container: add more distro aliases
Add a system to define distro name aliases and use that to define some
additional aliases, primarily to match ubuntu codenames rather than
version numbers. Requested by Zack.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 65f055f0d8
)
This commit is contained in:
parent
a1c73426ea
commit
0adecbe761
@ -102,6 +102,28 @@ class DistroKind(StrEnum):
|
|||||||
def uses_dnf(cls):
|
def uses_dnf(cls):
|
||||||
return {cls.CENTOS8, cls.CENTOS9, cls.CENTOS10, cls.FEDORA41}
|
return {cls.CENTOS8, cls.CENTOS9, cls.CENTOS10, cls.FEDORA41}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def aliases(cls):
|
||||||
|
return {
|
||||||
|
str(cls.CENTOS10): cls.CENTOS10,
|
||||||
|
"centos10stream": cls.CENTOS10,
|
||||||
|
str(cls.CENTOS8): cls.CENTOS8,
|
||||||
|
str(cls.CENTOS9): cls.CENTOS9,
|
||||||
|
"centos9stream": cls.CENTOS9,
|
||||||
|
str(cls.FEDORA41): cls.FEDORA41,
|
||||||
|
"fc41": cls.FEDORA41,
|
||||||
|
str(cls.UBUNTU2204): cls.UBUNTU2204,
|
||||||
|
"ubuntu-jammy": cls.UBUNTU2204,
|
||||||
|
"jammy": cls.UBUNTU2204,
|
||||||
|
str(cls.UBUNTU2404): cls.UBUNTU2404,
|
||||||
|
"ubuntu-noble": cls.UBUNTU2404,
|
||||||
|
"noble": cls.UBUNTU2404,
|
||||||
|
}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def from_alias(cls, value):
|
||||||
|
return cls.aliases()[value]
|
||||||
|
|
||||||
|
|
||||||
class DefaultImage(StrEnum):
|
class DefaultImage(StrEnum):
|
||||||
CENTOS10 = "quay.io/centos/centos:stream10"
|
CENTOS10 = "quay.io/centos/centos:stream10"
|
||||||
@ -636,7 +658,8 @@ def parse_cli(build_step_names):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--distro",
|
"--distro",
|
||||||
"-d",
|
"-d",
|
||||||
choices=[str(f) for f in DistroKind],
|
choices=DistroKind.aliases().keys(),
|
||||||
|
type=DistroKind.from_alias,
|
||||||
default=str(DistroKind.CENTOS9),
|
default=str(DistroKind.CENTOS9),
|
||||||
help="Specify a distro short name",
|
help="Specify a distro short name",
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user